Skip to content

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

Closed
@eddyb

Description

@eddyb

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-themesArea: Themes for HTML pages generated by rustdocT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions