Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx7 multiline signatures contain very wide line spacing that is not changeable. #1529

Open
lvthanh03 opened this issue Sep 29, 2023 · 1 comment
Labels
Bug A bug Needed: replication Bug replication is required

Comments

@lvthanh03
Copy link

lvthanh03 commented Sep 29, 2023

Problem

image

Cannot change line-height through custom theme CSS:

image

Project to reproduce

Set maximum_signature_line_length = 1 in Sphinx conf.py. Generate any python docs.

Error Logs/Results

Other themes show much more reasonable line-height, or give the ability to change line-height.

Environment Info

  • Python Version: 3.8.10
  • Sphinx Version: 7.1.2
  • RTD Theme Version: 1.3.0
@lvthanh03 lvthanh03 added Bug A bug Needed: replication Bug replication is required labels Sep 29, 2023
@Zac-HD
Copy link

Zac-HD commented Jan 31, 2024

Possibly fixed by #1450? In the meantime, I've found adding some custom CSS does fix this for me:

/* Take out pointless vertical whitespace in the signatures. */
.rst-content dl .sig dl,
.rst-content dl .sig dd {
  margin-bottom: 0;
}

/* Make signature boxes full-width, with view-source and header links right-aligned. */
.rst-content dl .sig {
  width: -webkit-fill-available;
}
.rst-content .viewcode-link {
  display: inline-flex;
  float: inline-end;
  margin-right: 1.5em;
}
.rst-content .headerlink {
  position: absolute;
  right: 0.5em;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: replication Bug replication is required
Projects
None yet
Development

No branches or pull requests

2 participants