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

Enhanced contrast theme, for users with visual restrictions etc. #1353

Closed

Conversation

tim-seoss
Copy link
Contributor

@tim-seoss tim-seoss commented Oct 15, 2020

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!

@tim-seoss tim-seoss force-pushed the enhanced_contrast_theme_addition branch 3 times, most recently from 63ea308 to a5faf1b Compare October 15, 2020 17:34
@tim-seoss
Copy link
Contributor Author

tim-seoss commented Oct 16, 2020

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.

@tim-seoss tim-seoss force-pushed the enhanced_contrast_theme_addition branch from a5faf1b to 756b764 Compare October 16, 2020 08:48
@tim-seoss
Copy link
Contributor Author

Tweaked --inline-code-color based on feedback, and force-pushed.

@tim-seoss tim-seoss force-pushed the enhanced_contrast_theme_addition branch from 756b764 to 27c8204 Compare October 16, 2020 10:26
@pojntfx
Copy link

pojntfx commented Jan 9, 2021

I'd like to second this. Both the default light and dark Navy theme fail the WAVE accessibility test ATM.

@endgame
Copy link

endgame commented Jan 13, 2021

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.)

@iamfrank
Copy link

I endorse this pull request.

mdBook has some issues in the accessibility department - text contrast for readability being one of them.
This makes mdBook a no-go on any publicly facing website, since web applications are required to adhere to WCAG standards in our part of Europe.

@tim-seoss
Copy link
Contributor Author

tim-seoss commented Feb 14, 2021

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).
[EDIT - fixed now]

@tim-seoss tim-seoss force-pushed the enhanced_contrast_theme_addition branch from 27c8204 to 2aaf705 Compare February 14, 2021 16:39
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/
@tim-seoss tim-seoss force-pushed the enhanced_contrast_theme_addition branch from 2aaf705 to 910780f Compare February 14, 2021 16:41
@ehuss
Copy link
Contributor

ehuss commented Feb 14, 2021

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.

@tim-seoss
Copy link
Contributor Author

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.

@tim-seoss
Copy link
Contributor Author

I've created a new PR #1470 which supersedes this, in response to feedback here, and elsewhere.

@tim-seoss tim-seoss closed this Feb 21, 2021
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.

5 participants