-
Notifications
You must be signed in to change notification settings - Fork 211
Don't override the user's fonts #240
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
Conversation
This patch is similar in spirit to rust-lang/blog.rust-lang.org#263, though it's also less invasive; it removes the specific font overrides in style.css so that the browser will use the user's configured fonts. The net result of the change is that the page will look less "uniform" across different browsers, OSes, and devices, but the overall aesthetic should be preserved. It also means that user preferences are respected, and that legibility is improved for users with particular font needs, or on platforms that sometimes gets confused about how to render fonts nicely (ehrm, Linux).
This patch is similar in spirit to rust-lang/blog.rust-lang.org#263 and onur/docs.rs#240; it removes the specific font overrides in rustdoc.css so that the browser will use the user's configured fonts. This reduces the weight of all rustdoc pages (yay for mobile!) while also letting users use whatever fonts they prefer. The net result of the change is that the page will look less "uniform" across different browsers, OSes, and devices, but the overall aesthetic should be preserved. It also means that user preferences are respected, and that legibility is improved for users with particular font needs, or on platforms that sometimes gets confused about how to render fonts nicely (ehrm, Linux).
Hi @jonhoo, thanks for the PR. I love my user fonts more than fonts we used in rustdoc/docs.rs but I'd like to stick to rustdoc decision and use same fonts on docs.rs. |
In that case, I think the font list should at least be changed like this: -$font-family-sans: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
-$font-family-serif: "Source Serif Pro",Georgia,Times,"Times New Roman",serif;
-$font-family-mono: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
+$font-family-sans: "Fira Sans", sans-serif;
+$font-family-serif: "Source Serif Pro",serif;
+$font-family-mono: "Source Code Pro", monospace; The intermediate fonts can be quite ugly on Linux machines :) |
You may also need to do the same thing as rustdoc does, and pull in the primary fonts in case the user doesn't have them. |
i'm too lazy at the moment and don't feel like grepping through the CSS to In the meantime I configured Firefox to disable web font overrides (breaks Google Docs fonts, but I don't care at the moment). |
@jimbo1qaz The upstream rustdoc PR was eventually closed without merging, so it's unlikely that this will remove the overrides either. May i ask why you want to remove them? |
Fira Sans has an uncomfortably large x-height for my tastes (lowercase characters feel disproportionately huge and uppercase/ascenders small), which grates with me on PC displays. This is a design choice of Fira Sans (designed for small phone screens on Firefox OS). And the use of SCSS string-replacements, not CSS variables, makes it painfully difficult for me to override the CSS myself. I could define a @font-face named Fira Sans and referencing my own preferred font (sadly not sans-serif), but getting the right names of all weights and italic right is a hassle. Google Fonts CSS's local() uses the wrong name half the time. turns out i pinged a user called font-face :| |
I don't think we plan to merge this. If something changes upstream in rustdoc, feel free to reopen. |
This patch is similar in spirit to rust-lang/blog.rust-lang.org#263, though it's also less invasive; it removes the specific font overrides in style.css so that the browser will use the user's configured fonts.
The net result of the change is that the page will look less "uniform" across different browsers, OSes, and devices, but the overall aesthetic should be preserved. It also means that user preferences are respected, and that legibility is improved for users with particular font needs, or on platforms that sometimes gets confused about how to render fonts nicely (ehrm, Linux).