Skip to content

Native: adjust colours to meet WCAG AAA contrast guidelines #2038

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

Merged
merged 1 commit into from
Jan 23, 2022

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Jan 17, 2022

I used both WAVE (Web Accessibility Evaluation Tool) and the CSS Overview panel in Chrome DevTools to identify these by checking https://python.github.io/peps/pep-0008/.

https://wave.webaim.org/report#/https://python.github.io/peps/pep-0008/

https://developer.chrome.com/blog/new-in-devtools-87/#css-overview

Some of the colours already met AA (all but one of these are for Native):

image

But I've bumped them all to AAA using Chrome's suggestions. They provide two suggestions, one to meet AA (4.5:1) and another for AAA (7:1).

For example, inspect element:

image

Click the colour box:

image

And click the icon to the right of the 🚫 to select AAA:

image

Demo

Before: https://python.github.io/peps/pep-0008/#other-recommendations
After: https://hugovk.github.io/peps/pep-0008/#other-recommendations

Before, 137 contrast errors: https://wave.webaim.org/report#/https://python.github.io/peps/pep-0008/
After, no contrast errors: https://wave.webaim.org/report#/https://hugovk.github.io/peps/pep-0008/

@Anteru
Copy link
Collaborator

Anteru commented Jan 17, 2022

First of all: Thanks for working on improved accessibility! However, I think something is up with your demo, both links show the exact same colors, and if I run the wave.webaim.org links , they show the same number of contrast errors? Am I missing something here?

@hugovk
Copy link
Contributor Author

hugovk commented Jan 17, 2022

Ah sorry, I should have added this needs to be in dark mode. Either put your OS into dark mode or click the icon at the top right:

image

@hugovk
Copy link
Contributor Author

hugovk commented Jan 23, 2022

Some screenshots because my demo page will likely get reset to upstream/main at some point.

Before

image

After

image

@Anteru Anteru added this to the 2.12.0 milestone Jan 23, 2022
@Anteru Anteru added A-theming area: changes to themes changelog-update Items which need to get mentioned in the changelog labels Jan 23, 2022
@Anteru Anteru merged commit 1458c66 into pygments:master Jan 23, 2022
@Anteru
Copy link
Collaborator

Anteru commented Jan 23, 2022

Merged, thanks! The changes are subtle but worth it, IMHO, thanks for working on this.

@hugovk hugovk deleted the native-contrast branch January 23, 2022 14:55
@hugovk
Copy link
Contributor Author

hugovk commented Jan 23, 2022

And thank you for maintaining Pygments, I find code in documentation much easier to read with syntax highlighting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-theming area: changes to themes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants