fix: ToggleButton provides an opt-in isAccessible variant for accessible checked colors#35837
Open
smhigley wants to merge 2 commits intomicrosoft:masterfrom
Open
fix: ToggleButton provides an opt-in isAccessible variant for accessible checked colors#35837smhigley wants to merge 2 commits intomicrosoft:masterfrom
smhigley wants to merge 2 commits intomicrosoft:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous Behavior
If the author doesn't have an icon in their ToggleButton, or doesn't change the icon between visually distinct variants for checked vs. unchecked, the ToggleButton doesn't meet a11y requirements for color contrast / not color alone for checked vs. unchecked in any appearance variant:
unchecked:

checked:

Note: the outline variant does increase the border thickness, but since the border itself has less than 3:1 contrast, it doesn't help. In our story we do have an icon change so these specific buttons would be OK, but would fail without the icon.
New Behavior
An opt-in variant to each appearance that has actual contrasting color changes (or a stroke) to indicate the checked state. This was done w/ the design team, and checked w/ partners. In the future/v10, we should make the opt-in behavior the default, but for now it's opt-in.
unchecked:

checked:

I also added a story for the variant, and a11y docs for ToggleButton that explain when & why to use it.
Related Issue(s)