-
Notifications
You must be signed in to change notification settings - Fork 239
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
Adjust code colours to have minimum 7:1 contrast #4064
Conversation
✅ You can preview this change here:
To edit notification comments on pull requests, go to your Netlify site configuration. |
I agree it looks muddy and starts to defeat the purpose of the syntax highlighting which is a shame. What do you think about making the offending colours bold instead? This would get around the contrast issue as the text would now count as large scale in WCAG's deffinition. This is what it looks like from playing around on the live site: To my eye it looks weird now but I don't hate it. What do you think? |
@owenatgov I agree with it looking kinda funky, kinda overwhelming, not sure I like it that much. Starts rolling into the zone of... I can imagine it potentially looking weird having all inline code blocks in bold as well. Think I'll look into alternative themes to see if there's anything we can do with that 🤔 |
I think it would be worth checking these colours against APCA as well. Ideally we'd like to be future-proof and APCA generally gives user-friendlier results than WCAG 2.2 AAA colour checks. |
. |
Hi both, I’ve been giving this some thought: I’m fully on board with not using bold for the text. It might unintentionally make it seem like we’re placing more emphasis on certain parts, and could even come across as if we're "shouting" at the users. I think it’s best to keep the text unbolded for a more balanced and approachable tone. I have some concerns around using orange and red together. I left this comment in the slack earlier: I noticed that we’re using both orange and red in the code text, but the two colours appear quite similar, which makes it hard to distinguish between them. Since they’re meant to convey different information, it might be confusing. Also the fact that i couldn’t even differentiate the two when i first reviewed this. So instead we can try replacing orange with purple (#4c2c92) ? |
We've decided that if we were to update code snippets to meet WCAG Level AAA's contrast minimums, we want to solve this problem in a more thorough and reusable way rather than only updating our red and green shades. That is, we would want to find or create a syntax highlighting palette that:
As our current code snippets and syntax highlighting are already compliant with WCAG Level AA, which is what we're required to meet, we're going to table this work for the time being. |
Changes the shades of red and green used in code blocks to ensure a minimum 7:1 contrast on a light grey background, satisfying WCAG Level AAA. Resolves #4012.
Changes
code
and Highlight.js to have a minimum 7:1 contrast ratio with light grey.Thoughts