Skip to content
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

Closed
shixiedesign opened this issue May 14, 2019 · 6 comments
Assignees
Labels
Milestone

Comments

@shixiedesign
Copy link
Contributor

shixiedesign commented May 14, 2019

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

  • add 1px inner border to Primary, Secondary, and Danger buttons on Dark themes
  • border colors are in spec image below

A few more design issues to resolve here before it is ready for dev. This issue is currently blocked by

Button dark themes2

@elizabethsjudd
Copy link
Contributor

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?

@shixiedesign
Copy link
Contributor Author

shixiedesign commented May 15, 2019

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.

@shixiedesign shixiedesign changed the title [Button] Add border bottom to Primary, Secondary, and Danger buttons for dark theme accessibility [Button] Add border to Primary, Secondary, and Danger buttons for dark theme accessibility May 15, 2019
@shixiedesign
Copy link
Contributor Author

shixiedesign commented May 15, 2019

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.

@shixiedesign shixiedesign removed their assignment May 15, 2019
@shixiedesign shixiedesign self-assigned this May 16, 2019
@shixiedesign
Copy link
Contributor Author

shixiedesign commented May 17, 2019

Alternative solution

Ultimate 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:

Button dark themes Copy

@shixiedesign shixiedesign changed the title [Button] Add border to Primary, Secondary, and Danger buttons for dark theme accessibility [Button] Accessibility fix for Primary, Secondary, and Danger buttons for dark themes May 24, 2019
@shixiedesign

This comment has been minimized.

@shixiedesign
Copy link
Contributor Author

shixiedesign commented Jun 28, 2019

Update

This 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

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

No branches or pull requests

3 participants