-
Notifications
You must be signed in to change notification settings - Fork 237
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
Code blocks: Colour contrast issues #4012
Comments
@querkmachine from today (16th Oct) stand up, @hazalarpalikli confirmed that this could work, so we are ready to merge it once you are back. |
Just wanna re-emphesise @selfthinker's comment before we go ahead and merge: #4064 (comment) |
@Izabela-16 @querkmachine @owenatgov Leaving this comment here as well: 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) ? |
@Izabela-16 just had a chat with Owen, we are removing this ticket from this cycle as it might need some more thinking. |
Following #4064 as an attempt to fix this, we've decided we're not going to resolve this issue. |
This issue is from the accessibility audit of the Design System website by DAC in July 2024.
DAC's description
Red on grey
The colour contrast on the red text against the grey background failed to meet the expected ratio to pass WCAG 2.2 AAA. The expected ratio for colour contrast with text should be at least 7:1, however the colour contrast ratio for text within this element is 4.51:1. This may be problematic for visually impaired users.
Foreground:
#D13118
Background:
#F3F2F1
Font Size: 16px
Ratio: 4.51:1
Current code:
Green on grey
The colour contrast on the green text against the grey background failed to meet the expected ratio to pass WCAG 2.2 AAA. The expected ratio for colour contrast with text should be at least 7:1, however the colour contrast ratio for text within this element is 5.84:1. This may be problematic for visually impaired users.
Foreground:
#00703C
Background:
#F8F8F8
Font Size: 19px
Ratio: 5.84:1
Current code:
DAC's proposed solution
For sites to meet AAA, they must comply with WCAG 2.2 checkpoint 1.4.6 for colour contrast.
As far as contrast ratio is concerned, it must at least be:
Thoughts on solution
We could take inspirations from other syntax highlighting projects, like ericwbailey/a11y-syntax-highlighting or mpchadwick/pygments-high-contrast-stylesheets.
Related issues
Additional instances
This will appear wherever there are code blocks. But they would only need fixing once in the CSS file for code highlighting for all of them.
Needed roles
Designer
The text was updated successfully, but these errors were encountered: