-
Notifications
You must be signed in to change notification settings - Fork 201
feat(swatch): add support for lightBorder #2954
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
feat(swatch): add support for lightBorder #2954
Conversation
🦋 Changeset detectedLatest commit: fd3914f 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: 4.63 MB* Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
Detailsswatch
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
🚀 Deployed on https://pr-2954--spectrum-css.netlify.app |
95d01c8
to
c27c597
Compare
c27c597
to
8a7c07c
Compare
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.
This is good and it works! I left some questions about the code, but another question I have is about what color this light border should be. In the PR description, you note that Miruna said gray-1000
20% for both dark and light mode, but I think this might be a color token that only exists in Spectrum 2? But in that case, it does have different rgb values for dark and light, so maybe rgba(0, 0, 0, 20%)
wouldn't be used for both dark and light mode?
Clarification on the color would be great, I think that's about the only thing holding me back from approval here!
f755911
to
82ed60e
Compare
028e0c3
to
0499047
Compare
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 great in dark and light mode! 🎉 Thanks @marissahuysentruyt!
0499047
to
7488287
Compare
- implement spectrum-Swatch--lightBorder class for swatches in a swatch group that have low contrast - build new mods for swatch-border-color-light - add changeset
7488287
to
fd3914f
Compare
Description
During the documentation migration work in #2925, it was noticed that the "light border" variant didn't have corresponding CSS. After some digging, I found that we did support it at one point, but it may have accidentally gotten deleted. When reading the Slack messages linked in #1501, it sounds like a light border variant should have been supported, but I believe that was one of the "open questions" related to that PR. This PR re-implements the modifier class
.spectrum-Swatch--lightBorder
based on a new conversation with design.I restarted this conversation with Miruna and got clarification from her:
me:
...I've been migrating a bunch of documentation from our static site to storybook. I saw on the static site there was a "light border" variant that we don't currently support, and also found on the Spectrum guidance page that there should be a border around a swatch with low contrast to its background. Right now, we don't have any CSS for this. I was just going to add it during my docs migration, but wanted to double check first that we still should be supporting this, or if I just found outdated info.
Miruna:
me: For the lightBorder, do the values change at all between light/dark modes?
Miruna:
This PR does not address any S2 design recommendations, but does set up CSS support for swatches to have a light border. Further implementation of
--lightBorder
should be seen in #2925 after this PR is merged.Jira ticket
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
.spectrum-Swatch
. Verify the swatch has its default border (rgba(0, 0, 0, 0.51)
) in light mode.rgba(255, 255, 255, 0.51)
is for dark/darkest mode).spectrum-Swatch--lightBorder
class to the element. Verify the border has changed torgba(0, 0, 0, 0.2)
.spectrum-Swatch--lightBorder
class should mimic the border behavior from before, but now uses--spectrum-Swatch-border-color-light
that has a 20% opacity (instead of 51%). You may have to re-add the--lightBorder
class each time you change color modes. 😩Regression testing
Validate:
Screenshots
To-do list