Skip to content

fix(stepper): clarify mod definitions #3670

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

Closed

Conversation

marissahuysentruyt
Copy link
Collaborator

Description

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:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

Screenshots

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • I have tested these changes in Windows High Contrast mode.
  • If my change impacts other components, I have tested to make sure they don't break.
  • If my change impacts documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

in express, for focus-hover-invalid was defined as transparent, but that
looks like a bug.
- updates metadata
- updates some selectors for bug fixes and easier translation in swc
Copy link

changeset-bot bot commented Apr 15, 2025

⚠️ No Changeset found

Latest commit: ed0a922

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/fix-reduce-mod-definitions branch from 2e9834f to ed0a922 Compare April 15, 2025 17:40
@@ -38,7 +38,6 @@
/** Invalid **/
--spectrum-stepper-border-color-invalid: transparent;
--spectrum-stepper-border-color-focus-invalid: transparent;
--spectrum-stepper-border-color-focus-hover-invalid: transparent;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: this was looking like a bug on focus+hover. double check if this change is necessary any more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-04-15 at 2 21 37 PM

I don't have a more defined grasp on why that's showing up now, except that it's now part of the textfield mod stack, so it makes sense that it's rendering now.

Comment on lines +269 to +270
--mod-infield-button-border-color: var(--highcontrast-stepper-border-color, var(--mod-stepper-border-color-hover, var(--spectrum-stepper-border-color-keyboard-focus)));
--mod-textfield-border-color-hover: var(--highcontrast-stepper-border-color, var(--mod-stepper-border-color-hover, var(--spectrum-stepper-border-color-keyboard-focus)));
Copy link
Collaborator Author

@marissahuysentruyt marissahuysentruyt Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes correct some keyboard focus hover border colors.

For a keyboard focused stepper, we were relying on the regular hover border color (which is gray-600, I believe):

Screenshot 2025-04-15 at 1 45 04 PM

It's now changed to gray-800 (just keeping the keyboard focus color even on hover), but is that correct? It felt like a bug, but that is how textfield, combobox, and picker all work. However, with this update, the default stepper now behaves like the invalid default stepper, where the keyboard focus border color does not respond to hovering or not.

Screenshot 2025-04-15 at 1 46 07 PM

Copy link
Contributor

github-actions bot commented Apr 15, 2025

🚀 Deployed on https://pr-3670--spectrum-css.netlify.app

Copy link
Contributor

github-actions bot commented Apr 15, 2025

File metrics

Summary

Total size: 2.25 MB*
Total change (Δ): 🟢 ⬇ 4.59 KB (-0.20%)

Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.

Package Size Minified Gzipped Δ
stepper 19.39 KB 18.49 KB 2.39 KB 🔴 ⬆ 1.05 KB

File change details

stepper

Filename Head Minified Gzipped Compared to base
index-base.css 17.70 KB 16.88 KB 2.25 KB 🔴 ⬆ 1.05 KB
index-theme.css 2.77 KB 2.69 KB 0.66 KB -
index.css 19.39 KB 18.49 KB 2.39 KB 🔴 ⬆ 1.05 KB
metadata.json 9.01 KB - - 🔴 ⬆ 0.05 KB
themes/express.css 2.10 KB 2.03 KB 0.65 KB 🔴 ⬆ 0.04 KB
themes/spectrum-two.css 2.23 KB 2.15 KB 0.64 KB -
themes/spectrum.css 2.23 KB 2.16 KB 0.65 KB -

tokens

Filename Head Minified Gzipped Compared to base
css/dark-vars.css 48.04 KB - - 🟢 ⬇ 0.28 KB
css/global-vars.css 44.20 KB - - -
css/index.css 201.96 KB - - 🟢 ⬇ 4.04 KB
css/large-vars.css 32.08 KB - - -
css/light-vars.css 48.00 KB - - 🟢 ⬇ 0.28 KB
css/medium-vars.css 32.24 KB - - -
json/tokens.json 289.94 KB - - -
* Size is the sum of all main files for packages in the library.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

}
}

&.is-keyboardFocused {
--mod-infield-button-border-color: var(--highcontrast-stepper-border-color, var(--mod-stepper-border-color-keyboard-focus, var(--spectrum-stepper-border-color-keyboard-focus)));
--mod-textfield-border-color-keyboard-focus: var(--highcontrast-stepper-border-color, var(--mod-stepper-border-color-keyboard-focus, var(--spectrum-stepper-border-color-keyboard-focus)));
Copy link
Collaborator Author

@marissahuysentruyt marissahuysentruyt Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm remembering correctly, following the variables in dev tools, I noticed that this textfield mod was undefined. Adding it here fixed what seemed like a styling bug, where the buttons and textfields were behaving differently between the default & invalid variants.

Production:

Screen.Recording.2025-04-15.at.2.00.03.PM.mov

This branch:

Screen.Recording.2025-04-15.at.2.01.56.PM.mov

@@ -254,15 +256,18 @@
/* stylelint-disable-next-line max-nesting-depth -- @todo reduce complexity of selectors */
&:hover {
--mod-infield-button-border-color: var(--highcontrast-stepper-border-color, var(--mod-stepper-border-color-focus-hover, var(--spectrum-stepper-border-color-focus-hover)));
--mod-textfield-border-color-focus: var(--highcontrast-stepper-border-color, var(--mod-stepper-border-color-focus-hover, var(--spectrum-stepper-border-color-focus-hover)));
Copy link
Collaborator Author

@marissahuysentruyt marissahuysentruyt Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A similar situation here as described above, where this textfield mod was actually the mod we needed for the focus+hover. It was undefined when I looked through dev tools.


&:hover {
--mod-infield-button-border-color: var(--highcontrast-stepper-border-color, var(--mod-stepper-border-color-focus-hover-invalid, var(--spectrum-stepper-border-color-focus-hover-invalid)));
--mod-textfield-border-color-invalid-hover: var(--highcontrast-stepper-border-color, var(--mod-stepper-border-color-focus-hover-invalid, var(--spectrum-stepper-border-color-focus-hover-invalid)));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another similar finding, that we were missing a textfield mod in the invalid state.

--mod-infield-button-border-color: var(--mod-stepper-buttons-border-color-focus-hover, var(--spectrum-stepper-buttons-border-color-focus-hover));
--mod-textfield-focus-indicator-width: 0;
--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)));
--mod-infield-button-border-color: var(--mod-stepper-buttons-border-color-focus-hover, var(--spectrum-stepper-border-color-focus-hover));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplest solution to this border color issue was using --spectrum-stepper-border-color-focus-hover, instead of --spectrum-stepper-buttons-border-color-focus-hover. That kept coming up undefined, even though it was in the spectrum-two.css file.

--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)));
--mod-infield-button-border-color: var(--mod-stepper-buttons-border-color-focus-hover, var(--spectrum-stepper-border-color-focus-hover));
--mod-textfield-focus-indicator-width: var(--mod-stepper-focus-indicator-width, 0);
--mod-textfield-border-color-focus: var(--mod-stepper-border-color-focus, var(--spectrum-stepper-border-color-focus-hover));
Copy link
Collaborator Author

@marissahuysentruyt marissahuysentruyt Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mod for just the textfield border wasn't working, but changing it to the focus border mod did. 🤷‍♀️

Comment on lines +173 to +178
&:hover:not(.is-invalid, .is-disabled, .is-focused, .is-keyboardFocused) {
--mod-infield-button-border-color: var(--mod-stepper-buttons-border-color-hover, var(--spectrum-stepper-buttons-border-color-hover));
}

&:not(.is-disabled) {
.is-focused,
&.is-focused,
Copy link
Collaborator Author

@marissahuysentruyt marissahuysentruyt Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since number field has been tricky as of late, can we update these selectors?

I'm pretty sure both of these selector changes were updated in this PR (we deprioritized a couple of months ago, that's all).

@marissahuysentruyt marissahuysentruyt added the do not merge A flag for a branch indicating it should not be merged. label Apr 16, 2025
@marissahuysentruyt marissahuysentruyt self-assigned this Apr 16, 2025
@marissahuysentruyt
Copy link
Collaborator Author

mod in question already had other mods within their definitions that customers can target to customize. No action needed 😊

tied/related to #3558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge A flag for a branch indicating it should not be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant