mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-26 22:05:14 +00:00
![]() Set font size proportional to user's font size According to MDN (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size), > To maximize accessibility, it is generally best to use values that are relative to the user's default font size. > Defining font sizes in px is not accessible, because the user cannot change the font size in some browsers. Note that changing font size (in browser or OS settings) is distinct from the zoom functionality triggered with Ctrl/Cmd-+. Zoom functionality increases the size of everything on the page, effectively applying a multiplier to all pixel sizes. Font size changes apply to just text. For relative font sizes, we could use `em`, as we do in several places already. However that has a problem of "compounding" (see MDN article for details). The compounding problem is nicely solved by `rem`, which make font sizes relative to the root element, not the parent element. Since we were using a hodge-podge of pixel sizes, em, rem, and percentage sizes before, this change switches everything to rem, while keeping the same size relative to our old default of 16px. 16px is still the default on most browsers, for users that haven't set a larger or smaller font size. Part of #59845. Note: this will conflict with #92404. We should merge that first (once it's done) and I'll resolve the merge conflicts. r? `@GuillaumeGomez` Demo: https://rustdoc.crud.net/jsha/font-size-access/std/string/struct.String.html |
||
---|---|---|
.. | ||
bootstrap | ||
build_helper | ||
ci | ||
doc | ||
etc | ||
librustdoc | ||
llvm-project@6b3dbcc81a | ||
rustdoc-json-types | ||
test | ||
tools | ||
README.md | ||
stage0.json | ||
version |
This directory contains the source code of the rust project, including:
- The test suite
- The bootstrapping build system
- Various submodules for tools, like rustdoc, rls, etc.
For more information on how various parts of the compiler work, see the rustc dev guide.