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

fix(react-toolbar): use contrasting token pairs for radio & toggle selected states #33579

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

smhigley
Copy link
Contributor

@smhigley smhigley commented Jan 7, 2025

Previous Behavior

We overrode the color for the selected state for the Radio & ToggleButton Toolbar variants, otherwise using all styles from ToggleButton. Overriding just the selected color value meant that the color/background token pair was not a pair with guaranteed contrast, which caused the Teams high contrast theme to fail contrast checks in that state.

In Teams high contrast:
Screenshot of the Teams high contrast theme showing a white icon on a light blue background

New Behavior

After chatting with design, we decided to go with adopting the subtle variant of the ToggleButton's styles for the selected state for radio & toggle Toolbar buttons.

New colors in teams high contrast:
Screenshot of the same button with a black icon on a light blue background

The other themes end up with the same hex values, so there is no visible change.

Related Issue(s)

@smhigley smhigley requested review from chpalac, ling1726 and a team as code owners January 7, 2025 23:32
@github-actions github-actions bot added this to the January Project Cycle Q1 2025 milestone Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.164 MB
291.227 kB
1.164 MB
291.289 kB
530 B
62 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
69.21 kB
20.174 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
222.703 kB
64.42 kB
react-components
react-components: FluentProvider & webLightTheme
44.447 kB
14.59 kB
react-portal-compat
PortalCompatProvider
8.39 kB
2.64 kB
react-timepicker-compat
TimePicker
108.525 kB
36.087 kB
🤖 This report was generated against 8f763922d713d9ccd35e65db07206c10b170fafd

Copy link

github-actions bot commented Jan 7, 2025

Pull request demo site: URL

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.

2 participants