rustdoc: tweak line spacing and paragraph spacing for accessibility#93694
Merged
bors merged 1 commit intorust-lang:masterfrom Feb 9, 2022
Merged
rustdoc: tweak line spacing and paragraph spacing for accessibility#93694bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
Some changes occurred in HTML/CSS/JS. |
11 tasks
Collaborator
|
☔ The latest upstream changes (presumably #93689) made this pull request unmergeable. Please resolve the merge conflicts. |
d2d71c1 to
6db0356
Compare
Member
Collaborator
|
☔ The latest upstream changes (presumably #93738) made this pull request unmergeable. Please resolve the merge conflicts. |
b7c2d29 to
9ae788d
Compare
GuillaumeGomez
approved these changes
Feb 8, 2022
Member
Collaborator
|
📌 Commit 9ae788d0c4539f83b9502b5bbbf724d5e8a4b216 has been approved by |
Collaborator
|
☔ 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
Contributor
Author
|
@bors r=GuillaumeGomez |
Collaborator
|
📌 Commit dd5ff42 has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 9, 2022
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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