-
Notifications
You must be signed in to change notification settings - Fork 198
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(picker,infieldbutton): updates custom properties for background/border colors #3536
base: main
Are you sure you want to change the base?
fix(picker,infieldbutton): updates custom properties for background/border colors #3536
Conversation
🦋 Changeset detectedLatest commit: a09845c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
🚀 Deployed on https://pr-3536--spectrum-css.netlify.app |
File metricsSummaryTotal size: 2.25 MB*
File change detailsinfieldbutton
picker
stepper
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
98d4003
to
7ed42b6
Compare
7ed42b6
to
267be6c
Compare
ff7b723
to
b2e29f1
Compare
@@ -20,7 +20,7 @@ | |||
--spectrum-picker-background-color-active: var(--spectrum-gray-200); | |||
--spectrum-picker-background-color-key-focus: var(--spectrum-gray-200); | |||
|
|||
--spectrum-picker-border-color-default: var(--spectrum-gray-800); | |||
--spectrum-picker-border-color-default: var(--spectrum-gray-500); |
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.
we were using the wrong border color for the default picker.
--spectrum-infield-button-background-color: var(--spectrum-gray-100); | ||
--spectrum-infield-button-background-color-hover: var(--spectrum-gray-200); | ||
--spectrum-infield-button-background-color-down: var(--spectrum-gray-200); | ||
--spectrum-infield-button-background-color-key-focus: var(--spectrum-gray-100); | ||
--spectrum-infield-button-background-color-key-focus: var(--spectrum-gray-200); |
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.
These changes, along with the stepper changes, are not reflected in Figma yet. They're working on updating them, but decided to have the stepper buttons' background color match the s2 picker background color.
b2e29f1
to
9551a1a
Compare
@@ -265,7 +265,7 @@ | |||
border-color: var(--highcontrast-picker-focus-indicator-color, var(--mod-picker-focus-indicator-color, var(--spectrum-picker-focus-indicator-color))); | |||
} | |||
|
|||
&.is-placeholder { | |||
.is-placeholder { |
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.
Let me know if I'm missing anything by removing &
here. I felt like I was fighting the specificity when further down in this file, there's another color
style declaration.
The reason I removed it (besides that it was a bug caught by design!) was because these are the tokens/styles we want and design pointed out we were missing (for the key-focus
tokens), but in the other &.is-placeholder
selector under .spectrum-Picker-label
(line 364ish), the color was computing to the default instead.
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 looks like the right correction to the selector, since .is-placeholder
doesn't live on the root class according to the template (it's on the nested span with the spectrum-Picker-label
class). 👍
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.
My only concern is in having an is-
prefixed class unattached to a specific element. Should we add .spectrum-Picker-label
in front of it to ensure we don't end up with an unexpected nested class getting targeted?
edit: ✅ done |
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.
Borders, background, and key-focused placeholder color looking as expected given the context.
9551a1a
to
0d10404
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 all of the validation steps and everything looks good! ✨
0d10404
to
983d985
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.
I think this is good to go! Left an additional comment to confirm what I'm supposed to be seeing with these latest changes.
@@ -170,7 +170,7 @@ | |||
--mod-textfield-border-color-disabled: var(--spectrum-stepper-border-color-disabled); | |||
} | |||
|
|||
&:hover:not(.is-invalid, .is-disabled) { | |||
&:hover:not(.is-invalid, .is-disabled, .is-focused) { |
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.
So to clarify, this means that we do not want the border color on the stepper to lighten (or I guess darken, in dark mode) when we hover when it's focused, right? So visually focus + hover should look the same as focus only?
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.
Pretty much, yes. In the focus state, we do not want the borders (any of the borders) to be --spectrum-stepper-border-color-hover
- we would want --spectrum-stepper-border-color-focus-hover
. This was another bug Matt Davey found from before foundations was merged. You can really see it in dark mode, where the infield button border color is black (or almost black?) when hovering over the focus state. Currently, on production, the focus+hover and keyboardFocus+hover are less apparent, but still incorrect.
But yes- we do not want the hover border color to take over. We should see the focus-hover border color instead.
63c40ff
to
89ab810
Compare
89ab810
to
408ed9a
Compare
* fix(picker): update default border-color to gray-500 - also updates metadata.json * fix(infieldbutton): update tokens for background color - updates gray-50 to gray-100 for default background color - updates gray-100 to gray-200 for down and hover state background color - updates metadata.json to reflect changes These fixes should align the stepper infield buttons with the style behavior of other form elements (particularly to match picker). * fix(picker): update font color for focus state - in the keyboard focus state, the picker value/placeholder font color was resolving to gray-800, when gray-900 was expected. - create changeset * fix(stepper): fix border color for focus&hover
408ed9a
to
a09845c
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.
One suggestion regarding the .is-placeholder
modifier but otherwise this looks great.
@@ -265,7 +265,7 @@ | |||
border-color: var(--highcontrast-picker-focus-indicator-color, var(--mod-picker-focus-indicator-color, var(--spectrum-picker-focus-indicator-color))); | |||
} | |||
|
|||
&.is-placeholder { | |||
.is-placeholder { |
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.
My only concern is in having an is-
prefixed class unattached to a specific element. Should we add .spectrum-Picker-label
in front of it to ensure we don't end up with an unexpected nested class getting targeted?
Description
🐛
For the S2 foundations theme, a bug was caught where the picker, in the context of a form, where the picker just looked out of place. It was decided that the default border color of the picker was the culprit. Sure enough, the default border color was incorrectly defined as
gray-800
, while all other form elements were usinggray-500
as the default border color. This PR fixes that bug. 🥾After design input, it was also decided to update the stepper button background color (
spectrum-InfieldButton
) to match the new S2 picker styles.Jira/Specs
CSS-1112
S2 picker Figma file
Slack conversation with Lynn & Matt
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
We now expect the border colors of all form components (including the picker) use
gray-500
as their default border color.--spectrum-textfield-border-color
is defined asgray-500
(@cdransf)--spectrum-picker-border-color-default
is now defined asgray-500
as well. (@cdransf)gray-900
, orneutral-content-color-focus
. (@cdransf).spectrum-Stepper-buttons
and.spectrum-InfieldButton-fill
elements) to verify the--spectrum-stepper-buttons-background-color
and--spectrum-infield-button-background-color
both are defined atgray-100
. (@cdransf).spectrum-Stepper-button
,--spectrum-infield-button-background-color-hover
should be defined asgray-200
. (@cdransf)Additional Validation
spectrum-Stepper is-focused
) in the browser. Verify that--mod-stepper-border-color
is resolving to--spectrum-stepper-border-color-focus
. (@cdransf)--mod-stepper-border-color
should then resolve to--spectrum-stepper-border-color-focus-hover
. (@cdransf)NOTE: The "Additional Validation" for the stepper focus-hover state is only partially fixed. A more thorough fix can be found on this branch: https://github.com/adobe/spectrum-css/tree/marissahuysentruyt/fix-stepper-border-focus-hover-color
Regression testing
Validate:
Screenshots
Before 🚫
After ✅
To-do list