refactor(stepper): standardize selectors and passthroughs usage#3558
refactor(stepper): standardize selectors and passthroughs usage#3558marissahuysentruyt wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 876ee12 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*
File change detailsbutton
stepper
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
89ab810 to
408ed9a
Compare
6ac2359 to
9632409
Compare
408ed9a to
a09845c
Compare
9632409 to
f09bfc4
Compare
a09845c to
220b448
Compare
f09bfc4 to
6f014e1
Compare
4482b05 to
a73d206
Compare
6f014e1 to
ce36838
Compare
|
🚀 Deployed on https://pr-3558--spectrum-css.netlify.app |
5ff92bd to
4243813
Compare
| --spectrum-stepper-border-color-hover: var(--spectrum-gray-600); | ||
| --spectrum-stepper-border-color-focus: var(--spectrum-gray-800); | ||
| --spectrum-stepper-border-color-focus-hover: var(--spectrum-gray-800); | ||
| --spectrum-stepper-border-color-focus-hover: var(--spectrum-gray-900); |
There was a problem hiding this comment.
The s2 token specs say gray-900 for focus+hover
| --spectrum-stepper-buttons-border-color: var(--spectrum-gray-500); | ||
| --spectrum-stepper-buttons-background-color: var(--spectrum-gray-100); | ||
| --spectrum-stepper-buttons-border-color-hover: var(--spectrum-gray-600); | ||
| --spectrum-stepper-buttons-border-color-focus: var(--spectrum-gray-800); | ||
| --spectrum-stepper-buttons-border-color-keyboard-focus: var(--spectrum-gray-900); |
There was a problem hiding this comment.
I found it easier to use the --mod-stepper-border-color all over, in tandem with the --mod-infield-button-border-color to target the stepper buttons. However, if we remove these, would this be a breaking change?
|
|
||
| /** Invalid **/ | ||
| --spectrum-stepper-border-color-invalid: var(--spectrum-negative-border-color-default); | ||
| --spectrum-stepper-border-color-hover-invalid: var(--spectrum-negative-border-color-hover); |
There was a problem hiding this comment.
Looked like we were missing the invalid hover color (token specs)
| &.is-focused, | ||
| &:focus { |
There was a problem hiding this comment.
The additional :not(.is-disabled) was making it really, really difficult to target these mods and nested styles. Removing them helped, and I don't think I saw any regressions with the disabled states. Please double check that all of the disabled styles are winning out and rendering, even though I removed the :not().
4243813 to
570459d
Compare
| &.is-disabled:not(.spectrum-Stepper--quiet) { | ||
| --spectrum-stepper-border-color-disabled: transparent; | ||
| } |
There was a problem hiding this comment.
Selector "&.is-disabled:not(.spectrum-Stepper--quiet)" is not used or defined in the base file (themes/spectrum-two.css).
570459d to
6bf8376
Compare
- fixes the focus & focus hover states, so that hovering over either element (the textfield OR the stepper buttons) will trigger the SAME border color for both elements. - removed some of the :not(disabled) to simplify selectors. - add keyboardfocused+hovered test - keyboardfocused+hovered states showcase hovering over any part of the element triggers the SAME border color for the textfield and the infield buttons - corrects the s1 borders for disabled steppers in quiet & default variants - corrects the focus+hover state in express - metadata updated and removal of code/TODO comments
de13e95 to
3206b0b
Compare
| --mod-textfield-border-color: var(--highcontrast-stepper-border-color-focus-hover, var(--mod-stepper-border-color-focus-hover, var(--spectrum-stepper-border-color-focus-hover))); | ||
| } | ||
| } | ||
| &:not(.is-disabled).is-keyboardFocused, |
There was a problem hiding this comment.
The keyboard-focus still has differing border colors in the textfield vs. stepper buttons.
c68f4e3 to
d2272ea
Compare
|
This has been worked out in the migration PR: #3681 |
Description
During #3536, we found that the stepper had more bugs particularly in dark mode, and particularly when you hovered over other states, like focus or keyboard-focus. This PR should revamp the CSS so that the stepper states are triggered in the expected way, where hovering over any of the nested subcomponents triggers the correct border color changes to all subcomponents. As an example, hovering over the stepper buttons should trigger a border color change in the stepper buttons, AS WELL AS trigger the border color on the stepper textfield.
The PR also adds
focus + hover&keyboardFocus + hoverChromatic test cases to ensure we don't miss that state in the future.Jira/Specs
CSS-1127
Also related to CSS-1112
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
A couple of notes while reviewing:
Regression testing
Validate:
Screenshots
Before 🚫




After ✅




To-do list