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

rustdoc CSS does not reset line-height to a non-zero value in <pre>. #105906

Closed
eddyb opened this issue Dec 19, 2022 · 1 comment · Fixed by #105912
Closed

rustdoc CSS does not reset line-height to a non-zero value in <pre>. #105906

eddyb opened this issue Dec 19, 2022 · 1 comment · Fixed by #105912
Labels
A-rustdoc-themes Area: Themes for HTML pages generated by rustdoc T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@eddyb
Copy link
Member

eddyb commented Dec 19, 2022

Due to GitHub's strict limitations on HTML styling, one of the few ways I found to reduce font size has been the use of <sub>/<sup> tags. However, I recently stumbled upon a difference between GFM and rustdoc's theming:

on GitHub on crates.io (rustdoc also identical)
image image

To reproduce, this should be sufficient:

<sub>

```
one
two
three
```

</sub>

AFAICT, the difference is due to line-height: <sub>/<sup> set it to 0, and on GitHub we also have:

.markdown-body .highlight pre, .markdown-body pre {
  /* ... */
  line-height: 1.45;
  /* ... */
}

But rustdoc's normalize.css doesn't set line-height to anything in its code, kbd, pre, samp {...} rule.
I would suggest either line-height: normal or line-height: 1.15 (the latter is what it does for html).

(I hope crates.io uses rustdoc, otherwise this bug is basically duplicated to two uses of normalize.css)

@eddyb eddyb added the A-rustdoc-themes Area: Themes for HTML pages generated by rustdoc label Dec 19, 2022
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Dec 19, 2022
@jyn514
Copy link
Member

jyn514 commented Dec 19, 2022

cc @notriddle, you like to work on similar issues I think

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 20, 2022
…t, r=GuillaumeGomez

rustdoc: force pre tags to have the default line height

Fixes rust-lang#105906
@bors bors closed this as completed in f24c04c Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-themes Area: Themes for HTML pages generated by rustdoc T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants