-
Notifications
You must be signed in to change notification settings - Fork 201
fix(swatch): adjust disabled icon color across themes #3547
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(swatch): adjust disabled icon color across themes #3547
Conversation
🦋 Changeset detectedLatest commit: 93993fe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
File metricsSummaryTotal size: 2.25 MB*
swatch
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
🚀 Deployed on https://pr-3547--spectrum-css.netlify.app |
ce05221
to
c99d309
Compare
53a358a
to
2eaa453
Compare
@@ -61,7 +61,8 @@ | |||
|
|||
.spectrum-Swatch { | |||
--spectrum-swatch-focus-indicator-border-radius: 8px; | |||
--spectrum-swatch-icon-border-color: rgb(0 0 0 / 51%); | |||
--spectrum-swatch-icon-border-color: rgba(var(--spectrum-black-rgb), var(--spectrum-swatch-disabled-icon-border-opacity)); | |||
--spectrum-swatch-disabled-icon-color: var(--spectrum-white); |
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.
Updates as well as WHCM appearance checks out IMO 👍
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.
Ran through the validation steps and everything looks good to me.
With respect to
WHCM changes are acceptable. (I would love some feedback on this! The outline is back in WHCM, it looks similar to what it was in #1501 which is where this comment was added, that leads me to believe that this is correct, but I'm still questioning it.)
I checked this in Assistive Labs and I agree with the comment you linked to — the icon color itself provides sufficient contrast and I think a border would be unnecessary. ✨
ba17140
to
5181c74
Compare
5181c74
to
93993fe
Compare
* fix(textfield): update border and background color * fix(swatch): adjust disabled icon color across themes (#3547) * fix(textfield): update border color on keyfocus in s2 --------- Co-authored-by: [ Cassondra ] <castastrophe@users.noreply.github.com> Co-authored-by: rise-erpelding <54716846+rise-erpelding@users.noreply.github.com>
* fix(textfield): update border and background color * fix(swatch): adjust disabled icon color across themes (#3547) * fix(textfield): update border color on keyfocus in s2 --------- Co-authored-by: [ Cassondra ] <castastrophe@users.noreply.github.com> Co-authored-by: rise-erpelding <54716846+rise-erpelding@users.noreply.github.com>
Description
The primary aim here initially was to address a regression in S1/Express styles in which swatch's disabled icon in dark themes had changed in appearance (see screenshots). However, after consulting design, we discovered that the look of the icon was incorrect in all themes (and colors).
After troubleshooting and trying to match the icon to the design spec, it appears that the issue was in the svg markup used for the disabled icon in the CSS Storybook. The CSS storybook uses the cancel icon from the icons package, while the old deprecated docs site and SWC use custom markup.
The CSS changes bring the disabled swatch icon color back to the S1 and S2 specs for all themes, using
--spectrum-white
regardless of theme and light/dark, and using black rgb along with the opacity token for the border color.Additionally, template changes were made to adjust the svg in Storybook - it now matches what's used in SWC and what was previously used on the docs site.
CSS-1119
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
Regression testing
Validate:
Screenshots
Previous S1 disabled Swatch for light and dark themes:


Current (on


main
) S1 disabled Swatch for light and dark themes, demonstrating regression for dark theme from previous:Current (on


main
) S2 Foundations disabled Swatch for light and dark themes, note that colors are very similar to S1 overall:S2 Spec (S1 spec is very similar to this):

Fix (current PR) S2 Foundations disabled Swatch for light and dark themes, S1 and Express follow the same color pattern:


To-do list