-
Notifications
You must be signed in to change notification settings - Fork 195
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(*): define missing custom properties from theme directory #3476
base: spectrum-two
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: b4c0701 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 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-3476--spectrum-css.netlify.app |
File metricsSummaryTotal size: 1.73 MB* Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
Detailsactionbutton
avatar
button
clearbutton
dialog
infieldbutton
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
d72049e
to
1303a5e
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.
Nice work on this! I just wanted to double check with you on some of those action button "unused custom properties" (I left a comment). Otherwise, I didn't get any linter warnings/errors for each of the components ✅
@@ -410,3 +361,43 @@ a.spectrum-ActionButton { | |||
/* Augment the margin correction for the icon only scenario */ | |||
margin-inline-start: calc(var(--spectrum-actionbutton-edge-to-visual-only) - var(--spectrum-actionbutton-edge-to-text)); | |||
} | |||
|
|||
@media (forced-colors: active) { |
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.
👏 love the consistency in moving this to the bottom of the file
|
||
--spectrum-actionbutton-border-color-default: var(--highcontrast-actionbutton-border-color-default, var(--mod-actionbutton-border-color-default, var(--spectrum-gray-400))); | ||
--spectrum-actionbutton-border-color-hover: var(--highcontrast-actionbutton-border-color-hover, var(--mod-actionbutton-border-color-hover, var(--spectrum-gray-500))); | ||
--spectrum-actionbutton-border-color-down: var(--highcontrast-actionbutton-border-color-down, var(--mod-actionbutton-border-color-down, var(--spectrum-gray-600))); | ||
--spectrum-actionbutton-border-color-focus: var(--highcontrast-actionbutton-border-color-focus, var(--mod-actionbutton-border-color-focus, var(--spectrum-gray-500))); | ||
--spectrum-actionbutton-border-color-disabled: var(--spectrum-disabled-border-color); | ||
|
||
--spectrum-actionbutton-content-color-selected: var(--spectrum-gray-50); | ||
--spectrum-actionbutton-content-color-disabled: var(--spectrum-disabled-content-color); |
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 I saw you ask this in the channel about this (maybe?), but this definition is from main
, yeah? Just making sure I verified it in the right place!
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.
It is — it's not in s2-foundations-redux
(the custom property isn't present in index.css
or spectrum-two.css
and it's not used in index.css
). --spectrum-disabled-content-color
is widely used though, so I'm comfortable with this alias (but I'm I don't have strong opinions either way).
--spectrum-actionbutton-background-color-selected-disabled: var(--spectrum-transparent-black-100); | ||
|
||
--spectrum-actionbutton-background-color-selected: var(--spectrum-neutral-background-color-selected-default); | ||
--spectrum-actionbutton-background-color-selected-hover: var(--spectrum-neutral-background-color-selected-hover); | ||
--spectrum-actionbutton-background-color-selected-down: var(--spectrum-neutral-background-color-selected-down); | ||
--spectrum-actionbutton-background-color-selected-focus: var(--spectrum-neutral-background-color-selected-key-focus); |
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.
Looks like these were all just "Unused custom properties," which I get why we would remove. But are these the values we should be using?
--spectrum-actionbutton-background-color-selected-disabled: var(--spectrum-transparent-black-100); |
How does that work is the spectrum-two.css
in the foundations branch? It's late on a Friday so my brain might not be working hahaha
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.
Ah, good catch! It looks like those are unused because we replaced fallback definitions for quite a few mods with more generic Spectrum tokens. Those custom properties had been used here:
--mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-default-selected, var(--spectrum-neutral-background-color-selected-default));
--mod-actionbutton-background-color-hover: var(--mod-actionbutton-background-color-hover-selected, var(--spectrum-neutral-background-color-selected-hover));
--mod-actionbutton-background-color-down: var(--mod-actionbutton-background-color-down-selected, var(--spectrum-neutral-background-color-selected-down));
--mod-actionbutton-background-color-focus: var(--mod-actionbutton-background-color-focus-selected, var(--spectrum-neutral-background-color-selected-key-focus));
I know — in a lot of cases — we'll create component-specific aliases for tokens, but the implementation on spectrum-two
isn't doing that. For example:
s2-foundations-redux
--mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-default-selected, var(--spectrum-actionbutton-background-color-selected));
--mod-actionbutton-background-color-hover: var(--mod-actionbutton-background-color-hover-selected, var(--spectrum-actionbutton-background-color-selected-hover));
--mod-actionbutton-background-color-down: var(--mod-actionbutton-background-color-down-selected, var(--spectrum-actionbutton-background-color-selected-down));
--mod-actionbutton-background-color-focus: var(--mod-actionbutton-background-color-focus-selected, var(--spectrum-actionbutton-background-color-selected-focus));
--mod-actionbutton-background-color-disabled: var(--spectrum-actionbutton-background-color-selected-disabled);
--mod-actionbutton-border-color-default: transparent;
--mod-actionbutton-border-color-hover: transparent;
--mod-actionbutton-border-color-down: transparent;
--mod-actionbutton-border-color-focus: transparent;
--mod-actionbutton-border-color-disabled: transparent;
--mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-default-selected, var(--spectrum-actionbutton-content-color-selected));
--mod-actionbutton-content-color-hover: var(--mod-actionbutton-content-color-hover-selected, var(--spectrum-actionbutton-content-color-selected));
--mod-actionbutton-content-color-down: var(--mod-actionbutton-content-color-down-selected, var(--spectrum-actionbutton-content-color-selected));
--mod-actionbutton-content-color-focus: var(--mod-actionbutton-content-color-focus-selected, var(--spectrum-actionbutton-content-color-selected));
spectrum-two
--mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-default-selected, var(--spectrum-neutral-background-color-selected-default));
--mod-actionbutton-background-color-hover: var(--mod-actionbutton-background-color-hover-selected, var(--spectrum-neutral-background-color-selected-hover));
--mod-actionbutton-background-color-down: var(--mod-actionbutton-background-color-down-selected, var(--spectrum-neutral-background-color-selected-down));
--mod-actionbutton-background-color-focus: var(--mod-actionbutton-background-color-focus-selected, var(--spectrum-neutral-background-color-selected-key-focus));
--mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-default-selected, var(--spectrum-gray-25));
--mod-actionbutton-content-color-hover: var(--mod-actionbutton-content-color-hover-selected, var(--spectrum-gray-25));
--mod-actionbutton-content-color-down: var(--mod-actionbutton-content-color-down-selected, var(--spectrum-gray-25));
--mod-actionbutton-content-color-focus: var(--mod-actionbutton-content-color-focus-selected, var(--spectrum-gray-25));
Redux used the aliasing pattern, but the spectrum-two branch doesn't, so I'm not sure which pattern or direction to take. 😅 Does the fact that they're mods factor in too?
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.
Happy Monday 👋 Just wanted to clarify this comment. It looks like in s2-foundations-redux
that at least --spectrum-actionbutton-background-color-selected-disabled
is in fact used:
--mod-actionbutton-background-color-disabled: var(--spectrum-actionbutton-background-color-selected-disabled); |
I guess my question is the same, how are we reconciling what's going on in the foundations branch or main? I feel like I'm missing something 😵💫 maybe I'm thinking too hard, or not even looking in the right files.
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.
Ahhh, that makes sense! I pushed up 08087d which restores those and references that went missing from s2-foundations-redux
.
2f3fc28
to
16ddbc6
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.
Wow, this ended up being quite the collection of components, especially with actionbutton and dialog in the mix! It looks like you took care of all the no undefined custom props warnings, so that's great!
I think there are a few remaining oddities particularly with actionbutton, like the selected state content color (and also the default/disabled state border, which I didn't comment on within the code because I wasn't able to figure out if that was because of a missing/undefined custom prop or something else). Hopefully we can resolve them here, or if not, in the S2 migration. I'd also noticed that when I was running yarn build
on this branch that there were some lingering metadata changes that needed to be committed, but that may or may not still be an issue if your branch has been updated since then.
@@ -414,6 +414,6 @@ | |||
|
|||
@media (forced-colors: active) { | |||
.spectrum-Dialog { | |||
border: 1px solid var(--highcontrast-standard-dialog-border-color, rgba(var(--spectrum-black-rgb), var(--spectrum-overlay-opacity))); | |||
border: 1px solid rgba(var(--spectrum-black-rgb), var(--spectrum-overlay-opacity)); |
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.
Judging by what Marissa had done in her dialog migration PR #2860, this is probably the right call, but I'm not able to verify what it looks like because Dialog is looking like this for me:
Is anyone else having the same experience? If so, maybe we can make a follow-up card to look into this issue since it seems unrelated to the current fixes in this PR (if one doesn't already exist)?
Unless @marissahuysentruyt remembers the migration well enough and can spot something missing that would fix it here.
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.
Got it! I'm seeing the same but had gone ahead and lifted it from the S2 theme file on the redux branch. I'll wait for @marissahuysentruyt to chime in,
--mod-actionbutton-background-color-down: var(--mod-actionbutton-background-color-down-selected, var(--spectrum-neutral-background-color-selected-down)); | ||
--mod-actionbutton-background-color-focus: var(--mod-actionbutton-background-color-focus-selected, var(--spectrum-neutral-background-color-selected-key-focus)); | ||
|
||
--mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-default-selected, var(--spectrum-gray-25)); |
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.
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 left a few comments, fixed the |
4341683
to
b4c0701
Compare
Description
s2-foundations-redux
To-do list