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

rustdoc: brighten/darken link colors based on background color #93230

Closed
jsha opened this issue Jan 23, 2022 · 1 comment
Closed

rustdoc: brighten/darken link colors based on background color #93230

jsha opened this issue Jan 23, 2022 · 1 comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jsha
Copy link
Contributor

jsha commented Jan 23, 2022

The readability of text depends in part on its contrast relative to the background. For instance, in the light theme:

image

image

image

You can see that the contrast ratio is different depending on the background. Against a white background it's 4.97. Against a grey background it's 4.56. Not a huge difference, but noticeable. For reference, the WCAG guideline is that text should have a contrast ratio of at least 4.56.

We should pick an alternate link color that maintains the same contrast ratio when placed against the grey backgrounds we use (code highlighting and sidebar).

The same concept applies to the dark theme, in reverse - the link color should be brightened when it is against a lighter background, so it stays equally visible.

@camelid camelid added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 25, 2022
@jsha
Copy link
Contributor Author

jsha commented Jan 30, 2022

Fixed in #93231

@jsha jsha closed this as completed Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants