-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
crate name is too small #131589
Comments
cc @rust-lang/rustdoc-frontend |
We should probably increase the margin at the bottom of the search box, but the rest of it is determined by font metrics, and looks fine with different text. all red lines in the screenshot are exactly the same height The problem is that, though the word |
Rollup merge of rust-lang#131906 - notriddle:notriddle/spacing, r=GuillaumeGomez rustdoc: adjust spacing and typography in header Fixes rust-lang#131589 Preview: https://notriddle.com/rustdoc-html-demo-12/spacing/std/index.html | Before | After | |--|--| | ![image](https://github.com/user-attachments/assets/b5c5132d-1e5e-402e-ba19-1dea9e70ea6f) | ![image](https://github.com/user-attachments/assets/72570b93-bb16-4553-9da7-fc4f29b98873) | ![image](https://github.com/user-attachments/assets/264983f0-5aec-4120-8a03-f62e52d4360d) | ![image](https://github.com/user-attachments/assets/b6925945-95e6-4858-8e91-4cfd90c164f0) | ![image](https://github.com/user-attachments/assets/df96bfe7-195d-4aaf-97f1-a45ade34cab2) | ![image](https://github.com/user-attachments/assets/c6fe2d57-bd8a-42aa-b3cf-4f635809b9b4) | ![image](https://github.com/user-attachments/assets/7519faa5-d6b2-41ba-9d95-6000d1dd89d1) | ![image](https://github.com/user-attachments/assets/7233c2d6-82d9-4820-bb63-dc4776a34601) First of all, we put 4px additional margin below the search box, and 4px margin below the header to balance it out. The bigger problem we have to solve is making the lines look logically spaced. This is troublesome, because Fira Sans (the typeface we use here) wants to look good on average, and to avoid breaking, with text that uses [ascenders and descenders](https://www.w3.org/TR/css-inline-3/images/text-edge.png). If the text we're putting in happens to not have any, things look weird (strictly speaking, there’s hand-tuning here, because the Copy Path button messes with stuff, but the overall point is that there is no true, one perfect layout). In order to play nicely with the font, I've tweaked the text to use that space. The word "Source" for the link is now capitalized, and the Since version number now uses oldstyle nums with descenders.
for example:
when read https://docs.rs/futures/latest/futures/
the crate name size is big, as the crate name, this size is ok to hint people "the crate name is XXX"
however, when enter a module sub page, the crate name become too small
https://docs.rs/futures/latest/futures/future/index.html
it is too small, even make me wonder if my browser is broken to render the website, so I change to firefox, but nothing changed
also we can see the up spacing is shorter than the lower spacing, tha't so strange
and the source up spacing is short, but the lower spacing is too long, even three times the length
The text was updated successfully, but these errors were encountered: