-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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: adjust spacing and typography in header #131906
Conversation
rustbot has assigned @GuillaumeGomez. Use |
Some changes occurred in GUI tests. Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
@@ -164,6 +164,9 @@ h1, h2, h3, h4 { | |||
.docblock > h6:first-child { | |||
margin-top: 0; | |||
} | |||
.since, .version { | |||
font-variant-numeric: oldstyle-nums; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason behind this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the below screenshot of the new version, the three red lines are the same length. As you can see, the digits are the same height as the lowercase letters.
In the below screenshot of the old version, the red lines are also the same length. As you can see, the digits are taller than the lowercase letters.
The problem with the old version is that adding the digits makes the subheader appear closer to the main header, even if its CSS box doesn't move. This means that, in the old version, there is no "correct" spacing that will look right both with and without the digits.
This is, after all, the whole purpose of these "oldstyle" numerals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very convinced by this explanation as I find the new display of numbers very weird and the issue you mentioned to be very anecdotal. If you feel strongly about it, then let's go with it. Please just add a comment with the explanation you just wrote if you do so.
r=me with or without this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel that strongly about it. If you want to stick with the present-day format, it's okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! :)
2985b48
to
a53655a
Compare
Thanks for the improvement! @bors r+ rollup |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#129248 (Taking a raw ref (`&raw (const|mut)`) of a deref of pointer (`*ptr`) is always safe) - rust-lang#131906 (rustdoc: adjust spacing and typography in header) - rust-lang#132084 (Consider param-env candidates even if they have errors) - rust-lang#132096 (Replace an FTP link in comments with an equivalent HTTPS link) - rust-lang#132098 (rustc_feature::Features: explain what that 'Option<Symbol>' is about) r? `@ghost` `@rustbot` modify labels: rollup
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 | |--|--| |  |  |  |  |  |  |  |  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.
Fixes #131589
Preview: https://notriddle.com/rustdoc-html-demo-12/spacing/std/index.html
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. 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.