-
Notifications
You must be signed in to change notification settings - Fork 198
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(picker): high contrast and other color fixes #2326
Merged
Merged
Conversation
This file contains 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
🚀 Deployed on https://pr-2326--spectrum-css.netlify.app |
File metricsSummaryTotal size: 3.97 MB*
Detailspicker
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
a590ca4
to
b166d19
Compare
mdt2
approved these changes
Dec 6, 2023
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.
Looks good to me!
High contrast mode fixes for Picker. By default, the focus indicator outline was showing on the picker when it did not have focus. The colors were also reversed; these now mirror the focus indicator color and border color combination shown in textfield when keyboard focused. Also fixes some other high contrast colors that were a little off on hover and when the picker was open.
The foreground ButtonText needs to be paired with the matching background pair ButtonFace to ensure appropriate contrast (per W3C system colors spec).
- Use more appropriate ButtonBorder system color. - Make sure quiet variation has a matching background-foreground pair instead of having a transparent background with ButtonText foreground to ensure appropriate contrast. - Fix extra text backplate showing in WHCM edge default theme. - Simplify disabled border color by moving to a custom property. - Remove unnecessary repeated border-width declarations that were already inherited.
There were a lot of unnecessary highcontrast specific custom properties that were all repeating the same values. Refactors these to slim them down significantly, reducing the number of custom properties and making the WHCM styles much more readable. There was no need to have a highcontrast property for every state + open when the colors only change in very few places.
Move some quiet styles to existing quiet selector in the file, to keep things organized. The quiet disabled focus-visible rule from the moved block of CSS could be removed because it didn't do anything.
- Fix issue with "Closed and Disabled with Thumbnails" docs example showing the invalid border color on hover by adding a :not selector. The invalid hover rules were more specific than the disabled rules. - Fix wrong hover color appearing in WHCM on invalid examples.
Fix issue with grey background color showing on hover/click with the quiet variant. Due to the styles for .is-open being more specific.
b166d19
to
12f233e
Compare
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.
Description
Picker: A few fixes for forced-colors/Windows High Contrast Mode to address the bugs in CSS-636, along with a few more discovered when working on it. Along with some cleanup work.
Highlight
border color now appears on hover (except when keyboard focused).ButtonText
foreground needed aButtonFace
background to ensure appropriate contrast. TheButtonBorder
system color is also now used.In this work, I discovered and fixed these additional issues (not WHCM):
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Highlight
colorHighlight
Highlight
when hovering over the picker, except when the focus indicator is visibleRegression testing
Validate:
To-do list