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 · 2 comments
Labels
Bug A bug Needed: replication Bug replication is required
Milestone

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;
}

@v-49
Copy link

v-49 commented Dec 17, 2024

.large-text {
font-size: 1.3em; /* 根据需要调整大小 /
color: inherit; /
保持默认颜色,可以根据需要修改 /
font-weight: normal; /
根据需要调整字体粗细 /
}
.mid-text {
font-size: 1.1em; /
根据需要调整大小 /
color: inherit; /
保持默认颜色,可以根据需要修改 /
font-weight: normal; /
根据需要调整字体粗细 /
line-height: 0.7em /
调整行间距,值越小行间距越小 */
}
line-height still unchangeable;font-size: works but line-height cant
image

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

4 participants