-
Notifications
You must be signed in to change notification settings - Fork 201
feat(checkbox/group): s2 token migration, control spacing, subtle color changes #3531
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(checkbox/group): s2 token migration, control spacing, subtle color changes #3531
Conversation
🦋 Changeset detectedLatest commit: 10afa8e 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 |
🚀 Deployed on https://pr-3531--spectrum-css.netlify.app |
File metricsSummaryTotal size: 1.37 MB*
checkbox
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
8a329ce
to
6ca8078
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 a great start! I pointed out some of the changes that I thought were still needed to the CSS within the CSS file, but here's a quick rundown of what I think needs another look:
- Down state
- Some of the invalid default colors (emphasized colors seem to be working fine for whatever reason) - this is a (hopefully small) bugfix that I also noticed on main
- Typography use of tokens
- Updating CJK to match other components
- Probably removing some stray dist files
- There are SO many test cases covered already, but for some reason we don't have any focus, hover, or active states. I don't think there's any particular reason we've left them out as far as I know, so I'm wondering how you would feel about adding them? I think it would make catching bugs (like the bug I just mentioned above) a little easier!
As far as I can tell, I think the template.js and stories.js files for this component are fine, so probably no changes needed 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.
Should we have this components/checkbox/dist/index.css.map
and components/checkbox/dist/index.css
committed?
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.
Wondering if these dist files for progresscircle also need to be removed.
56c6806
to
793571c
Compare
f34473b
to
cf46c2b
Compare
0a7d424
to
cf46c2b
Compare
f6bfaa1
to
988b92a
Compare
dee81f5
to
ce2f3e0
Compare
644902d
to
f77a28f
Compare
components/checkbox/index.css
Outdated
/* WHCM settings */ | ||
.spectrum-Checkbox-box, | ||
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box, | ||
&.is-indeterminate .spectrum-Checkbox-input:checked + .spectrum-Checkbox-box, | ||
&.is-indeterminate .spectrum-Checkbox-box { | ||
&::before { | ||
border-color: var(--highcontrast-checkbox-color-default); | ||
} | ||
} | ||
|
||
&:hover { | ||
.spectrum-Checkbox-box::before, | ||
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box::before { | ||
border-color: var(--highcontrast-checkbox-color-default); | ||
} |
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.
High contrast only styles should live in the forced-colors media query. ✅
Also could these possibly be handled by changes to custom property values instead?
95af748
to
5923e29
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.
Left a comment about the testing grid!
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.
Leaving a question/comment about :active
, but the testing grid looks great!
Since I was already in selector land and thinking about the :active
pseudo-class, I have one other question/thought that I couldn't put in the code, some of @jawinn's previous feedback was:
I noticed this when testing the pseudo states and considering our :active selectors. The down state is not shown when tabbing to a checkbox and selecting it with space, which I'm guessing it should? I think this could be resolved by moving the :active to also apply to the input and not the root element---that'd need some testing.
That seems valid and hasn't been done yet, would something like this work? (Down around L170, inside of .spectrum-Checkbox
but after :hover
and :after
--this isn't new code in this PR so GitHub won't let me comment inline.)
&:not(.is-readOnly) {
.spectrum-Checkbox-input:active:not(:disabled) + .spectrum-Checkbox-box,
&:active .spectrum-Checkbox-input:not(:disabled) + .spectrum-Checkbox-box {
transform: perspective(var(--spectrum-component-size-minimum-perspective-down)) translateZ(var(--spectrum-component-size-difference-down));
}
}
…ss, and finding indeterminate bug
…tps://github.com/adobe/spectrum-css into aramos-adobe/css1016-checkbox-group-s2-migration
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.
All of my feedback items have been addressed and this is looking pretty good to me! Thanks for all your work on this!!
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.
Really close on this one. Thanks for addressing my last set of feedback.
-
On the PR link I'm seeing one background color difference on the Docs page for invalid indeterminate. It's not showing the darker red on focus like the regular checked:
-
In the testing preview grid refactoring, it looks like we lost some states that were important to test, such as the one that would catch number 1 above:
Focused + checked, focused + indeterminate, Focused + checked + invalid, focused + indeterminate + invalid, Hover + checked, hovered + indeterminate, hover + checked + invalid, hover + indeterminate + invalid, the same for read-only states, hover on disabled states
@rise-erpelding + @jawinn, just pushed some changes to the test grid before seeing Rise's suggestion. What do y'all think of this? I'm going to try Rise's suggestion as well to see what it looks like 😁
Screen.Recording.2025-04-17.at.4.16.45.PM.mov |
Just added "hovered and invalid" |
Checkbox/Group S2 Migrations
Checkbox has some new tokens for control and color. Most of the tokens have been updated in the global vars.
New tokens
--spectrum-component-size-width-ratio-down
--spectrum-checkbox-bottom-to-text(S,M,L,XL)
--spectrum-checkbox-top-to-control (S,M,L,XL)
--spectrum-accent-content-color-default
--spectrum-accent-content-color-hover
--spectrum-accent-content-color-down
--spectrum-accent-content-color-key-focus
Modified tokens
--spectrum-checkbox-checkmark-color
--spectrum-checkbox-invalid-color-down
--spectrum-checkbox-control-color-default
--spectrum-checkbox-control-color-hover
--spectrum-checkbox-control-color-down
--spectrum-checkbox-control-color-focus
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
To-do list