-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: tweak line spacing and paragraph spacing for accessibility #93694
Conversation
Some changes occurred in HTML/CSS/JS. |
☔ The latest upstream changes (presumably #93689) made this pull request unmergeable. Please resolve the merge conflicts. |
d2d71c1
to
6db0356
Compare
☔ The latest upstream changes (presumably #93738) made this pull request unmergeable. Please resolve the merge conflicts. |
b7c2d29
to
9ae788d
Compare
📌 Commit 9ae788d0c4539f83b9502b5bbbf724d5e8a4b216 has been approved by |
☔ The latest upstream changes (presumably #93762) made this pull request unmergeable. Please resolve the merge conflicts. |
The W3C Web Content Accessibility Guidelines specify a minimum line spacing of 1.5 and a minimum paragraph spacing of 1.5 times the line spacing. Our current line spacing (implemented by line-height) is 1.4, so it's a small bump to go up to 1.5. Similarly, we have a paragraph spacing of 0.6em. Bump that to 0.75em (which is 1.5 times the 0.5em distance between lines). Also, fix all the font sizes so instead of being round-ish numbers in rem (like 1.1rem, 1.2rem), they are round numbers in pixels. Ensure each font size is at least 2 pixels different than the nearest other font size, so distinctions can be clearly seen. Overall the font-sizes are mostly staying the same, being rounded up or down as appropriate. Remove a few unused styles. Simplify the display of the mobile-topbar location, by setting its margins to auto rather than trying to size it exactly to the topbar.
9ae788d
to
dd5ff42
Compare
@bors r=GuillaumeGomez |
📌 Commit dd5ff42 has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#93445 (Add From<u8> for ExitCode) - rust-lang#93694 (rustdoc: tweak line spacing and paragraph spacing for accessibility) - rust-lang#93735 (Stabilize int_abs_diff in 1.60.0.) - rust-lang#93746 (Remove defaultness from ImplItem.) - rust-lang#93748 (rustc_query_impl: reduce visibility of some modules/fn's) - rust-lang#93751 (Drop tracking: track borrows of projections) - rust-lang#93781 (update `ty::TyKind` documentation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The W3C Web Content Accessibility Guidelines specify a minimum line spacing of 1.5 and a minimum paragraph spacing of 1.5 times the line spacing. Our current line spacing (implemented by line-height) is 1.4, so it's a small bump to go up to 1.5. Similarly, we have a paragraph spacing of 0.6em. Bump that to 0.75em (which is 1.5 times the 0.5em distance between lines).
Also, fix all the font sizes so instead of being round-ish numbers in rem (like 1.1rem, 1.2rem), they are round numbers in pixels: 16px, 18px, 20px, 22px, 24px. Ensure each font size is at least 2 pixels different than the nearest other font size, so distinctions can be clearly seen. Overall the font-sizes are mostly staying the same, being rounded up or down as appropriate. This will make reasoning about consistent layout sizes much easier.
Remove a few unused styles.
Simplify the display of the mobile-topbar location, by setting its margins to auto rather than trying to size it exactly to the topbar.
Part of #59845.
Demo: https://rustdoc.crud.net/jsha/font-sizes-spacing/std/string/struct.String.html
r? @GuillaumeGomez