-
Notifications
You must be signed in to change notification settings - Fork 194
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(button -> negative): corrects interior label background color to align with parent #3078
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
430fe26
fix(button -> negative): corrects interior label background color to …
cdransf 4f7826f
fix(button): sets default text colors
cdransf 9456b9c
fix(button): sets default background colors; incorporates s2 migratio…
cdransf 352ce11
fix(button): adjusts outline border hover behavior in high contrast mode
cdransf dcc138e
Update .changeset/little-cows-hang.md
cdransf ae97d5b
fix(button): restore missing color properties; adjust indentation
cdransf 4dc7f9e
fix(button): adjust indentation
cdransf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@spectrum-css/button": minor | ||
--- | ||
|
||
Includes fixes and updates to the colors used in forced-colors / high contrast mode. In Windows high contrast, a different background was showing behind the label text, as a result of extra text readability backplates being rendered. `forced-color-adjust: none` is now applied to the child label element to fix this. The appropriate `ButtonFace`/`ButtonText` system colors are also now defined instead of relying on the default. The existing use of `Highlight` is now paired with `HighlightText` to ensure contrast by using a matching foreground/background pair. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -306,11 +306,30 @@ a.spectrum-Button { | |
/* Windows High Contrast Mode */ | ||
@media (forced-colors: active) { | ||
.spectrum-Button { | ||
--highcontrast-button-content-color-default: ButtonText; | ||
--highcontrast-button-content-color-hover: ButtonText; | ||
--highcontrast-button-content-color-focus: ButtonText; | ||
--highcontrast-button-content-color-down: ButtonText; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In addition, I think it would be a good idea to be explicit about setting the matching background color too. Right now we're relying on the default.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
--highcontrast-button-border-color-default: ButtonBorder; | ||
--highcontrast-button-border-color-hover: ButtonBorder; | ||
--highcontrast-button-border-color-focus: ButtonBorder; | ||
--highcontrast-button-border-color-down: ButtonBorder; | ||
--highcontrast-button-background-color-default: ButtonFace; | ||
--highcontrast-button-background-color-hover: ButtonFace; | ||
--highcontrast-button-background-color-down: ButtonFace; | ||
--highcontrast-button-background-color-focus: ButtonFace; | ||
--highcontrast-button-background-color-disabled: ButtonFace; | ||
--highcontrast-button-content-color-disabled: GrayText; | ||
--highcontrast-button-border-color-disabled: GrayText; | ||
|
||
--mod-progress-circle-track-border-color: ButtonText; | ||
--mod-progress-circle-track-border-color-over-background: ButtonText; | ||
--mod-progress-circle-thickness: var(--spectrum-progress-circle-thickness-medium); | ||
--mod-button-animation-duration: 0s; | ||
|
||
.spectrum-Button-label { | ||
forced-color-adjust: none; | ||
} | ||
|
||
&:focus-visible { | ||
&::after { | ||
|
@@ -322,18 +341,17 @@ a.spectrum-Button { | |
&.spectrum-Button--accent.spectrum-Button--fill { | ||
--highcontrast-button-background-color-default: ButtonText; | ||
--highcontrast-button-content-color-default: ButtonFace; | ||
--highcontrast-button-content-color-hover: HighlightText; | ||
--highcontrast-button-content-color-down: HighlightText; | ||
--highcontrast-button-content-color-focus: HighlightText; | ||
--highcontrast-button-background-color-disabled: ButtonFace; | ||
|
||
--highcontrast-button-background-color-hover: Highlight; | ||
--highcontrast-button-background-color-down: Highlight; | ||
--highcontrast-button-background-color-focus: Highlight; | ||
--highcontrast-button-content-color-hover: ButtonFace; | ||
--highcontrast-button-content-color-down: ButtonFace; | ||
--highcontrast-button-content-color-focus: ButtonFace; | ||
|
||
.spectrum-Button-label { | ||
forced-color-adjust: none; | ||
} | ||
--highcontrast-button-border-color-default: ButtonText; | ||
--highcontrast-button-border-color-hover: Highlight; | ||
--highcontrast-button-border-color-focus: Highlight; | ||
--highcontrast-button-border-color-down: Highlight; | ||
cdransf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} |
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
Oops, something went wrong.
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.
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.
While we're cleaning up these high contrast styles, could you bring over some of the changes I made in the spectrum 2 migration here? The use of the
Highlight
background should be paired withHighlightText
: 597d33fThere 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.
Let me know if this lines up with what you're expecting 853ddac#diff-97b5a7e747486aca74b3076354c28a00ef69dab3c91dc0806d926078198571a2R335
Thanks for taking a look! 🙂
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.
Thanks! Could you keep the
&.spectrum-Button--accent.spectrum-Button--fill
selector the same for now? Removing the fill class hasn't been done yet in S1, so keeping that the same should avoid needing changes on the SWC side.Also, really minor but it looks like the indentation needs an update there.
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.
Yep! Just reverted that.