-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Button] Accessibility fix for Primary, Secondary, and Danger buttons for dark themes #2729
Comments
For my own curiosity can you explain to me how adding a border makes this accessible? How was the white text on the colored buttons not accessible before? |
Hi @elizabethsjudd, I see what you are asking and yes this has been a bit of a debate on our side too. The underline makes sure component has a visual indicator that's 3:1 contrast against page background, Gray90 & Gray100. We fixed this with an underline because we cannot lighten the button fill color any more, because white text has to be 4.5:1 accessible against the button fill. So this is a fix to satisfy the rule, and arguably without real improvement to the component. |
We are likely gonna change from underline to a full border, which would make more sense, and would actually help with accessibility. Waiting on getting in alignment. Edit: YES WE ARE GOING FULL BORDER! Updated spec image above. |
Alternative solutionUltimate goal is to make sure buttons are accessible against background 3:1 and button labels are accessible against button fill 4.5:1. An alternative solution is to adjust our color palette. Adding border would cause issues for light theme buttons. Below buttons uses a lightened up version of the 60s grade colors: |
This comment has been minimized.
This comment has been minimized.
UpdateThis issue no longer describes the work done to address it. Making a new issue for palette changes, and making it a dependency of this issue. Once new palette is merged, button accessibility issue should be automatically fixed via tokens getting new values. Palette v2 issue #3226 |
Accessibility fix for Primary, Secondary, and Danger buttons on dark themes
Problem
The 60s grade colors are not 3:1 accessible on G90 backgrounds, and we cannot use 50s grade colors for fill of the components because label text is white, and white is not 4.5:1 accessible on grade 50s colors.
Previous solution now ditched
1px inner border
to Primary, Secondary, and Danger buttons on Dark themesA few more design issues to resolve here before it is ready for dev. This issue is currently blocked by
The text was updated successfully, but these errors were encountered: