-
Notifications
You must be signed in to change notification settings - Fork 1.1k
USWDS - Checkbox: Create high contrast styles for indeterminate checkboxes #5648
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
USWDS - Checkbox: Create high contrast styles for indeterminate checkboxes #5648
Conversation
…eterminate-high-contrast
…eterminate-high-contrast
…wds/uswds into cm-checkbox-indeterminate-high-contrast
…wds/uswds into cm-checkbox-indeterminate-high-contrast
&:indeterminate, | ||
&[data-indeterminate] { | ||
&, | ||
&:checked { | ||
@include format-input { | ||
@include add-background-svg($input-indeterminate); | ||
background-position: center center; | ||
background-size: units(1.5) auto; | ||
|
||
@media (forced-colors: active) { | ||
@include add-background-svg("checkbox-indeterminate-alt"); | ||
background-color: color(SelectedItem); | ||
} | ||
} | ||
} | ||
} |
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.
Moved styles above disabled content
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.
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.
Summary
Enhances @lpsinger’s indeterminate checkbox styles with high contrast styles.
Important
This PR only affects styles. There is currently no functionality implementation with indeterminate checkboxes. Clicking the checkbox will toggle the checkbox but will not change the icon.
Breaking change
This is not a breaking change.
Related issue
Closes #5645
Related pull requests
Release note will be added for feature branch
#5549
#5650
Preview link
Standard checkbox story →
Indeterminate checkboxes story →
Indeterminate checkbox tiles story →
Problem statement
#5549 introduces indeterminate checkbox styles. When viewed in high contrast modes, the icon is not always visible and checkboxes can still be visibly toggled.
Kapture.2023-10-23.at.13.16.41.mp4
Solution
Use the
SelectedItem
high contrast token to maintain a visible indeterminate icon. This change also visually enhances checked checkbox styles as well.Using
SelectedItem
will allow USWDS checkbox styles to reflect high contrast color customization set by the user.Develop:
Dark
Light
using
SelectedItem
:Dark
Light

Radio buttons
I opted to not change the radio selected color due to its low color contrast in light high contrast themes
Develop:
SelectedItem
:Contrast Ratio: 1.3:1
Testing and review
Activating high contrast mode on chrome
More tools
and selectRendering
forced-colors
and activate.Testing checklist