Skip to content
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

Improve site legibility #263

Merged
merged 1 commit into from
Sep 12, 2018
Merged

Improve site legibility #263

merged 1 commit into from
Sep 12, 2018

Conversation

jonhoo
Copy link
Contributor

@jonhoo jonhoo commented Jul 27, 2018

This may be a little controversial, but I figured I'd open a PR to get a conversation started. I realize that this PR may not be merged as-is :)

The current blog.rust-lang.org styles override most user settings (like font size and page font), and also overrides font properties like letter-spacing and line-height in a number of places which makes many fonts harder to read.

This patch removes unnecessary letter-spacing and line-height settings, as well as the forced Arial/Helvetica font override, an instead uses the user's chosen font and the font's settings for letter-spacing and line-height. It also removes the global override for initial page font size, so that the user's font size settings are preserved.

The blockquote styles are also update so that the quoted text is formatted similarly to the surrounding text (no italics, and no larger font size), and with a blacker grey to make the text more legible.

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, user preferences are respected, and legibility should generally be improved.

To take this further, all font-size style settings that use the px unit should also be changed to a relative unit like % or em so that they scale proportionally for users that have increased or decreased their browser default font size, but I'll leave that for another day.

This patch removes unnecessary letter-spacing and line-height settings,
as well as the forced Arial/Helvetica font override, an instead uses the
user's chosen font and the font's settings for letter-spacing and
line-height. It also removes the global override for initial page font
size, so that the user's font size settings are preserved.

The blockquote styles are also update so that the quoted text is
formatted similarly to the surrounding text (no italics, and no larger
font size), and with a blacker grey to make the text more legible.
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@jonhoo
Copy link
Contributor Author

jonhoo commented Jul 28, 2018

@rust-highfive r? @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

Can you add screenshots of before and after this change please? :)

@jonhoo
Copy link
Contributor Author

jonhoo commented Jul 28, 2018

Since this change causes user preferences to be taken into account, the screenshot will be just of what my browser is configured for, but that might still be useful. Here's a side-by-side of the updated version and the offical site for a single blog post in Firefox on Linux:
2018-07-28-121934_1920x1080_scrot

The front page has smaller changes:
2018-07-28-121929_1920x1080_scrot

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Jul 28, 2018

Makes it easier to read indeed. 👍 for me but not sure I'm the one who should give the go for this PR so let's wait for someone else.

@jonhoo
Copy link
Contributor Author

jonhoo commented Jul 28, 2018

👍

Yeah, I tried to figure out who's been touching style files lately, and it seems like changes to the styles are just really rare. It mostly seems to be @huonw back in 2015, with nearly no changes since, so I don't know that this is really anyone's responsibility at the moment..

@GuillaumeGomez
Copy link
Member

Well, let's give them a few days and if no one comes around then I'll just r+ it. Ping me in a few days.

@aturon
Copy link
Member

aturon commented Jul 29, 2018

cc @ashleygwilliams @steveklabnik

@jonhoo
Copy link
Contributor Author

jonhoo commented Aug 23, 2018

ping @GuillaumeGomez @aturon

@jonhoo
Copy link
Contributor Author

jonhoo commented Sep 1, 2018

bump @GuillaumeGomez @aturon again?

@GuillaumeGomez
Copy link
Member

Well I suppose it's good to go then (a few days became a few weeks after all). Thanks!

@bors: r+

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Sep 1, 2018

Oups hold on, I think bors doesn't run here. We need someone with merge rights.

@aturon: Can you merge please? :)

@jonhoo
Copy link
Contributor Author

jonhoo commented Sep 8, 2018

gentle nudge @aturon

@steveklabnik steveklabnik merged commit 51e0322 into rust-lang:gh-pages Sep 12, 2018
@steveklabnik
Copy link
Member

Sorry about taking so long here; I like it. Thanks!

@steveklabnik steveklabnik mentioned this pull request Sep 13, 2018
steveklabnik added a commit that referenced this pull request Sep 13, 2018
jonhoo added a commit to jonhoo/docs.rs that referenced this pull request Oct 1, 2018
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).
jonhoo added a commit to jonhoo/rust that referenced this pull request Oct 3, 2018
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants