-
Notifications
You must be signed in to change notification settings - Fork 233
fix(switch): down state styles take precedence over hover #5524
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(switch): down state styles take precedence over hover #5524
Conversation
🦋 Changeset detectedLatest commit: bca581c The changes in this PR will be included in the next version bump. This PR includes changesets to release 84 packages
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 |
Branch previewReview the following VRT differencesWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
If the changes are expected, update the |
Tachometer resultsChromeswitch permalinktest-basic
Firefoxswitch permalinktest-basic
|
36dda22
to
293e961
Compare
ae3b0ce
to
4ba214b
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.
Ran through validation steps and everything looks good! ✨
ceaa466
to
95e2b8c
Compare
95e2b8c
to
a5155e9
Compare
a5155e9
to
b89f32f
Compare
b89f32f
to
856fdb4
Compare
- corrects the active state colors for the handle and background, so it doesn't change if a user hovers or moves their mouse while still activating the switch. - ensure readonly switches don't show active state - add missing highcontrast variables - create changeset
856fdb4
to
bca581c
Compare
Description
This work builds off of the
spectrum-two
fix for this in adobe/spectrum-css#3767, but addressing the same bug in the S1 context for SWC components. The switch in either context should now respond appropriately to the active state, with the active styles taking precedence over any hover styles. When a user now activates the active/down state, a visual difference can be noted, and that visual difference is no longer dependent on mouse movement (where it was incorrect before).New behavior
Screen.Recording.2025-06-10.at.9.51.52.AM.mov
Motivation and context
It was brought up in a Slack bug report that the switch may have some specificity issues between the hover and active states. The original message noted how to reproduce what they were seeing:
Production (old behavior)
Screen.Recording.2025-06-10.at.9.48.11.AM.mov
Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch
,minor
, ormajor
featuresManual review test cases
S1
Unchecked switch down state styles
sp-switch
and toggle:active
and:hover
states in your browser tools.#switch::before
element renders--spectrum-switch-handle-border-color-down
[@cdransf]Checked switch down state styles
sp-switch
and toggle:active
and:hover
states in your browser tools.#switch::before
element renders--spectrum-switch-handle-border-color-selected-down
. [@cdransf]Additional validation
S2 foundations & Express
Device review