-
Notifications
You must be signed in to change notification settings - Fork 1k
USWDS - Disabled styles: Improve consistency in high contrast mode #5295
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
Conversation
…wds into cm-disabled-high-contrast
…o cm-disabled-high-contrast
…wds into cm-disabled-high-contrast
…wds into cm-disabled-high-contrast
…ed-high-contrast-border mixin
…cessary definitions
FYI - handing the reins back to @mahoneycm, who originated this work. Please direct any questions or comments to him. |
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.
Looking great! Disabled styles are consistent and adopt the system color for high-contrast disabled elements across all form elements! Thank you for your additions @amyleadem
I met with @amycole501 to discuss the high-contrast light mode screenshot she shared. It does indeed look like there was a shift in Chrome's high-contrast light theme colors. Before this change, disabled elements had a purple color instead of the maroon we are seeing in the screenshot.
Since we are dealing with system tokens, this color change is out of our control. We don't want to use a token that is not associated with the defined disabled palette so as to not confuse users who are expecting the pre-defined colors or who have made a custom high contrast and defined their disabled token color manually.
All we should be doing is setting it to the disabled system token (GrayText
) and let the user's system do the rest.
@mejiaj Ready for review! |
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.
@amyleadem @mahoneycm added some comments to re-use more of the existing mixins to keep this work more manageable.
packages/usa-input-prefix-suffix/src/styles/_usa-input-prefix-suffix.scss
Show resolved
Hide resolved
packages/uswds-core/src/styles/mixins/general/button-disabled.scss
Outdated
Show resolved
Hide resolved
Add to range slider track to replace no missing border
@mejiaj Thanks for catching those redundancies! Looking cleaner now 👍 |
Summary
Improved consistency of disabled styles in forced colors mode.
Breaking change
This is not a breaking change.
Related issue
Closes #5198
Related pull requests
Changelog: uswds/uswds-site#2102
Preview link
Preview link: Disabled form elements
Problem statement
PR #5063 introduces consistent disabled styles across all components. Viewing these components in high contrast mode exposes further inconsistency across components as well as missing icons & hover states.
Solution
This PR adds styles for disabled styles in forced-color mode.
Before:
After:
Testing and review
Turning on forced-colors mode in Chrome
Emulate CSS media feature forced-colors
forced-colors: active
prefers-color-scheme
emulation and test high contrast in light and dark themesTests