Skip to content

update status colors to meet wcag #7472

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 3 commits into from
Jan 22, 2025

Conversation

britt6612
Copy link
Collaborator

What does this PR do?

This PR updates the status colors in our base theme.

Color name Previous value Recommended value Rationale
status-ok #00C781 #009E67 Previous value had a contrast ratio of 2.02:1. New value has 3.06:1 and 5.5:1 in dark mode
status-warning #FFAA15 #C27B00 Previous value had a contrast ratio of 1.77:1. New value has 3.07:1 and 5.67:1 in dark mode
status-unknown #CCCCCC #919191 Previous value had a contrast ratio of 1.53:1. New value has 3.01:1 and 5.84:1 in dark mode
status-critical #FF4040 #EB0000* No change proposed to this color in this Issue, as previous value had a passing contrast ratio of 3.06:1. However, this color is proposed to be changed to meet 4,5:1 on white background in Form error ticket. This new value meets 3.15:1 in Notifications, and 4.36:1 in dark mode

Where should the reviewer start?

base theme

What testing has been done on this PR?

locally

How should this be manually tested?

locally

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

our colors were failing wcag

What are the relevant issues?

Screenshots (if appropriate)

Do the grommet docs need to be updated?

yes

Should this PR be mentioned in the release notes?

yes

Is this change backwards compatible or is it a breaking change?

@britt6612 britt6612 requested a review from jcfilben January 21, 2025 19:54
Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

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

Looks like just the status-critical and status-ok colors changed. Should there also be changes to status-warning and status-unknown?

Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

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

Looks good!

@jcfilben
Copy link
Collaborator

This color change affected some storybook stories. We will want to go back and clean up the Skeleton/Individual story and the Notification/Themed Notification story. This can be done in a separate PR

@jcfilben jcfilben requested a review from MikeKingdom January 21, 2025 21:56
Copy link
Collaborator

@MikeKingdom MikeKingdom left a comment

Choose a reason for hiding this comment

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

Given these changes are in base grommet as a minor update, I'm betting we're going to get some complaints/reactions about the status-warning change.

Given this example:
Old
image
New
image

The old text contrast ratio for the status-warning badge passed WCAG AAA and AA easily with a 12.52. The new ratio is 6.12 (and I find it rather hard to read.)

So I think although the new status-warning color helps support the contrast needed for icon differentiation (light or dark background) it will cause problems when text is over the top (even though it passes for AA)

That said I think we still need to go with the change, but I'm pretty sure we'll hear about the difference from partners.

@jcfilben
Copy link
Collaborator

^ good callout, I agree it's a necessary change but a bit awkward with backwards compatibility

@jcfilben jcfilben merged commit faf8219 into grommet:master Jan 22, 2025
13 of 14 checks passed
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.

3 participants