Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

fix(colors): improve a11y by increasing red contrast #12

Merged
merged 2 commits into from
Nov 29, 2021

Conversation

jayjayjpg
Copy link
Contributor

@jayjayjpg jayjayjpg commented Aug 4, 2021

While working on https:/meroxa/mx-ui-components/pull/21 our accessibility checks failed because the color contrast for red elements was too low.

According to WCAG 2.x, the color contrast between background and foreground colors needs to be at least 7.3:1 to meet the AAA level success criterion for color accessibility. You can learn more about WCAG success criteria for color contrast and why it matters for accessibility here

This darkens the red tone saffron-100 used for our button elements to be WCAG compliant when used in combination with white text.

Closes https:/meroxa/product/issues/92

before after
#DE583E #DC2626

@brettgoulder
Copy link
Contributor

brettgoulder commented Aug 4, 2021

Actually, we might have too much contrast here. I think WCAG AA should be sufficeint for colors.

What about something like #D64224 to get a 4.5:1 contrast ratio?

Screen Shot 2021-08-04 at 11 29 40 AM

@jayjayjpg jayjayjpg changed the title fix(colors): improve a11y by increasing red contrast [WIP] fix(colors): improve a11y by increasing red contrast Aug 5, 2021
@jayjayjpg
Copy link
Contributor Author

@brettgoulder Good catch!

@justmisosoup and @ogeyejammy made a good point, that we could also aim for the AAA level success criterion if we wanted to update this color, which would require a 7.3:1 ratio at minimum for elements with normal and small font-sizes. I agree that aiming for the highest success criterion would be ideal

A review of our color palette is in progress and I can update this PR accordingly a decision has been made

@brettgoulder
Copy link
Contributor

According to the W3 states "It is not recommended that Level AAA conformance be required as a general policy for entire sites because it is not possible to satisfy all Level AAA Success Criteria for some content."

I think it would be good to come to an understanding of what accessability criteria we are trying to shoot for.

@jayjayjpg
Copy link
Contributor Author

@brettgoulder @sara @justmisosoup Do we have consensus on the shade we could use for danger elements for now? I think we could also reiterate on the color in the future when the entire palette is updated

What are your thoughts?

@ogeyejammy
Copy link

ogeyejammy commented Aug 16, 2021 via email

@jayjayjpg
Copy link
Contributor Author

@ogeyejammy Thank you, that sounds good!

@jayjayjpg jayjayjpg changed the title [WIP] fix(colors): improve a11y by increasing red contrast fix(colors): improve a11y by increasing red contrast Nov 29, 2021
Copy link
Contributor

@brettgoulder brettgoulder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@jayjayjpg jayjayjpg merged commit 4ce603c into master Nov 29, 2021
@jayjayjpg jayjayjpg deleted the jj/update-red branch November 29, 2021 17:59
@jayjayjpg
Copy link
Contributor Author

Thank you! 🙇🏾‍♀️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants