USWDS - Checkbox: Create high contrast styles for indeterminate checkboxes#5648
Merged
thisisdano merged 10 commits intocheckbox-indeterminate-feature-branchfrom Feb 22, 2024
Conversation
…eterminate-high-contrast
…eterminate-high-contrast
…wds/uswds into cm-checkbox-indeterminate-high-contrast
3 tasks
…wds/uswds into cm-checkbox-indeterminate-high-contrast
mahoneycm
commented
Jan 22, 2024
Comment on lines
+145
to
+160
| &: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); | ||
| } | ||
| } | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Moved styles above disabled content
amyleadem
approved these changes
Jan 23, 2024
thisisdano
approved these changes
Feb 22, 2024
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.
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
SelectedItemhigh contrast token to maintain a visible indeterminate icon. This change also visually enhances checked checkbox styles as well.Using
SelectedItemwill 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 toolsand selectRenderingforced-colorsand activate.Testing checklist