-
Notifications
You must be signed in to change notification settings - Fork 2
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 too low contrast in subtitles for selected RadioGroup.Radios #1695
Conversation
name: 'selected item with subtitle', | ||
content: () => createComponent({ selected: 'four' }), | ||
}, | ||
]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
axe-core catched the accessibility issue in other project, but we were missing a test with selected radios.
These tests fail in main
.
I actually thought about this, but forgot to test it! Let me try that. |
f5c1704
to
60cebdb
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1695 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 66 66
Lines 1114 1115 +1
Branches 434 435 +1
=========================================
+ Hits 1114 1115 +1 ☔ View full report in Codecov by Sentry. |
60cebdb
to
9d2a378
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR fixes an accessibility issue in
RadioGroup
component, where the contrast between the text color used in subtitles and the background color used in selected radios, is too low.In order to fix it, we now set a darker shade of grey in the subtitles when the radio is hovered or selected.
See before and after:
Additionally, selected and hover radio background color is now set with an opacity lower than 100%. This ensures there's always a different color for those, even if the container's background color is the same as the color used for selected radios.
See how they look when the container has the former background color:
Before:
radio-no-alpha-2024-09-03_12.13.11.mp4
After:
radio-alpha-2024-09-03_12.13.44.mp4