-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Enhanced contrast theme, for users with visual restrictions etc. #1353
Enhanced contrast theme, for users with visual restrictions etc. #1353
Conversation
63ea308
to
a5faf1b
Compare
I've put a snapshot of https://github.com/rust-lang/book.git with the contrast theme added here: https://buttersideup.com/rustbook/ch04-02-references-and-borrowing.html In that snapshot, contrast is not the default theme, so you will need to select it using the '🖌' icon. |
a5faf1b
to
756b764
Compare
Tweaked |
756b764
to
27c8204
Compare
I'd like to second this. Both the default light and dark Navy theme fail the WAVE accessibility test ATM. |
After raising #1442, I was pointed at this PR. I would call the "contrast" theme almost strictly better than "light (default)". (After I found the theme change button, because I had no idea what the light-grey-on-white blob was actually representing.) |
I endorse this pull request. mdBook has some issues in the accessibility department - text contrast for readability being one of them. |
Although it's pretty close, in a couple of situations this theme fails to conform to the W3C WCAG 2.1 standard. I'll revise this PR to fix that (without that revision, this shouldn't be merged, I think). |
27c8204
to
2aaf705
Compare
This adds a "contrast" theme, which (insofar as it can) makes mdBook's output compliant with the W3C's WCAG ("Web Content Accessibility Guidelines") https://www.w3.org/WAI/standards-guidelines/wcag/
2aaf705
to
910780f
Compare
Hi @tim-seoss! Sorry for the long silence. I've actually been having private conversations with people about this PR. Would you be willing to change it so that it just updates the default light scheme? I would prefer to avoid adding new themes, and I think this one is better than the default, and I'd be happy to change it. |
OK, no problem, thanks for reviewing this! I'll try and get the PR updated tomorrow. As of today's revision, the text contrast is WCAG compliant, but... Now that my machine's blue light filter has come on during the evening, I've realised that the color contrast between the orange and magenta text (within code blocks) has dropped a bit further than I'd like, so I'll see if I can improve that. I expect the tweak to be subtle, but because the plan is now to change the default theme, I'd really like to make sure it's spot-on, so I'll see if I can get an accessibility specialist to review it too. |
I've created a new PR #1470 which supersedes this, in response to feedback here, and elsewhere. |
Now that I'm half way through my fifth decade, I find the default 'light' theme quite tiring for more than a few minutes.
Whilst reading mdBook material, I often find myself physically moving my face closer to the screen and/or zooming in more than I do on other similar material rendered with other frameworks.
I often use browser extensions to increase text contrast, but these don't cope well with mdBook's output (in particular, I haven't found one which works well with mdBook's syntax highlighting).
For my own use, I've created an enhanced contrast theme, based on the 'light' theme. I've also asked the opinions of others whilst viewing, and have received universally positive feedback, so I hope you will consider this addition to mdBook.
Any feedback welcome!