-
Notifications
You must be signed in to change notification settings - Fork 3
Use new tokens throughout Glide Core #750
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
Conversation
🦋 Changeset detectedLatest commit: e012f31 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 |
|
89fba95
to
b2e4e37
Compare
f81e15b
to
bdfaeaf
Compare
border-start-end-radius: 0.6875rem; | ||
} | ||
|
||
:host(:last-of-type) .component.vertical { | ||
border-block-end: none; |
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.
Needed to match the new designs. Otherwise the border looked doubled-up on the end with the other changes in this file.
&:hover { | ||
background-color: var( | ||
--glide-core-color-interactive-surface-container--hover | ||
); | ||
border-color: var( | ||
--glide-core-color-interactive-surface-container--hover | ||
); | ||
color: var(--glide-core-color-interactive-text-link); | ||
} |
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.
Button Group Button when selected now has hover styles according to the designs 🎉
@@ -9,7 +9,7 @@ import { | |||
type Node, | |||
} from 'typescript'; | |||
import postcss, { Comment, Declaration, Rule } from 'postcss'; | |||
import getParentClassName from '../library/get-parent-class-name.js'; | |||
import getParentClassName from './get-parent-class-name.js'; |
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.
Moved ../library/get-parent-class-name.js out from library and into the cem-analyzer-plugins directory instead. Figma code is all colocated. CEM plugin code can/should be too?
.indeterminate-icon { | ||
fill: var(--glide-core-private-color-checkbox-icon-default--disabled); | ||
stroke: var( | ||
--glide-core-private-color-checkbox-icon-default--disabled | ||
); | ||
} |
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.
Checkbox when indeterminate and disabled has a new visual design
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.
Moved to a constants.ts file for all configuration related items. This simplified the arguments to the different functions.
// This information can be found in Figma's | ||
// Deatils modal when clicking on an extended | ||
// style by combining the collection information | ||
// with the variable's full name. |
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.
.gitignore
Outdated
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 are no longer needed now that we've moved over to the new token code
custom-elements.json
Outdated
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.
Due to whitespace trimming in src/cem-analyzer-plugins/add-slots.ts
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.
Cleaned out most of these! The only items left are custom "effect styles" as they're referred to in Figma. I have a task to look into how we might pull these from Figma's API, but until then, these are manually updated and named to align with Figma.
.changeset/strong-penguins-kick.md
Outdated
- Button secondary and tertiary visual states have been redesigned. | ||
- Button colors in dark mode have been changed to different values. | ||
- Icon Button was updated to follow Button's changes. | ||
- Checkbox when indeterminate and disabled has a new visual design. | ||
- Split Button was visually redesigned. | ||
- Radio's selected, hover, and disabled visuals were updated. | ||
- Explicitly set `line-height`s were removed from most components. |
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.
Worth calling out a few more changes since these lead to visual regression test failures.
- Button secondary and tertiary visual states have been redesigned. | |
- Button colors in dark mode have been changed to different values. | |
- Icon Button was updated to follow Button's changes. | |
- Checkbox when indeterminate and disabled has a new visual design. | |
- Split Button was visually redesigned. | |
- Radio's selected, hover, and disabled visuals were updated. | |
- Explicitly set `line-height`s were removed from most components. | |
- Button secondary and tertiary visual states have been redesigned. | |
- Button colors in dark mode have been changed to different values. | |
- Icon Button was updated to follow Button's changes. | |
- Checkbox when indeterminate and disabled has a new visual design. | |
- Split Button was visually redesigned. | |
- Radio's selected, hover, and disabled visuals were updated. | |
- Explicitly set `line-height`s were removed from most components. | |
- Toast colors in dark mode have been changed to different values. | |
- Box shadow values have been redesigned. |
:root, | ||
.theme-light { | ||
--color-template-surface-background-page: #ffffff00; | ||
} | ||
|
||
:host, | ||
.theme-dark { | ||
--color-template-surface-background-page: #141414; | ||
} |
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 are extended styles for this. But they're only used by Storybook. It wasn't worth exposing these to the world just for this one case, in my opinion. Let me know if you feel differently.
cursor: pointer; | ||
display: flex; | ||
font-family: var(--glide-core-font-sans); | ||
font-size: var(--glide-core-body-md-font-size); | ||
font-style: var(--glide-core-heading-xxs-font-style); |
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.
Removed all font-style
as normal
is the default and we have no need for any other options.
font-family: var(--glide-core-body-sm-font-family); | ||
font-size: var(--glide-core-body-sm-font-size); | ||
font-style: var(--glide-core-body-sm-font-style); | ||
font-variant: var(--glide-core-body-sm-font-variant); |
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.
Similar to font-style
, we use the default font-variant
, so no need to be explicit.
Maybe we should rename that section to just Videos given we now have the visual report. |
@clintcs I was wondering the same actually. The visual test report handles images. I almost wonder if we remove "📸 Images and videos" completely? If you want to add a video, you can in the " 🚀 Description" section. I don't think folks add many videos these days. |
Went through all the changes. The visual report made doing so a breeze. Lots of nice dark mode improvements especially. Would you say dark mode is still beta? |
Our CSS custom properties have been updated to follow a new semantic token format: | ||
|
||
``` | ||
--glide-core-{collection}-{category*}-{scope*}-{property}-{variant*}--{state*} |
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.
Worth concisely defining what each semantic part means or providing an example variable?
I ask because I can imagine people reading this and immediately having questions or assuming that the terms map to technical terms.
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.
Great call. I'll cook something up here in a bit and get your thoughts!
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 what you think - this is directly from design: 714040b
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.
Works for me!
@@ -51,8 +51,8 @@ export default () => { | |||
}; | |||
} | |||
|
|||
const block = commentParser(`/** |
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.
Gotta love it.
@@ -105,12 +113,12 @@ export default [ | |||
/* The input obscures an offset outline for -webkit-calendar-picker-indicator, so 'focus-outline' is not used */ | |||
&[type='date'] { | |||
&::-webkit-calendar-picker-indicator { | |||
border-radius: var(--glide-core-border-radius-xs); | |||
padding: var(--glide-core-spacing-xxs); | |||
border-radius: 0.125rem; |
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. So we will still have some hardcoded values.
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.
Yeah, unfortunately in a few cases. It's on my list to go back through cases like this one and see if we can remove it in favor of another variable though!
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.
Either way. Still overall much more amenable to a lint rule against hardcoded values. The few left can just disable the rule.
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.
Totally agree!
No need to push another commit unless you want to. I can open a separate PR for this. |
@clintcs I contemplated removing this as well! I've got about another week or so left of work in the area of variables, so I imagine there will be a few more tweaks here and there. But once I get through those, I think we can safely remove the |
I can roll this in. Deletion incoming. |
Too late! |
18d5ac0
to
31a73b7
Compare
@danwenzel @clintcs should be all ready to go again. Had a few more rounds of review with design. It required a couple more iterations. We also reviewed the visual testing report multiple times and verified the changes are what we expect. I've broken things up into separate commits for easier reviewing:
If you wouldn't mind giving this a 👍 or re-approval after you've taken a look, I'd greatly appreciate it. I'm hoping to land this on Monday. |
Went through all the screenshots. Looks good to me! |
Same here, |
🚀 Description
This PR is pretty massive. I broke the changes into chunks. Feel free to review by commit as well (I'll be sure to squash on merge!).
Token Updates
We removed almost all of our old tokens in favor of the new ones using the code from #732. This moves every component to our new tokens using the script I wrote (and some manual ❤️). There's a lot here, sorry! But this brings us about 90% aligned with the new designs. The remaining 10% will be worked on over the next few weeks in downstream PRs as they're lower priority.
CSS Variable Generation Updates
Moved to a
constants.ts
file for all configuration related items. This simplified the arguments to the different functions.Line heights are now generated using
rem
values to match design.I updated our Figma fetching code to allow for extended styles. Extended styles are variables local to a component. They are prefixed with
--glide-core-private-
. We need to expose them due to the way our stylesheets work with themes. The hope is that the name-private-
prevents folks from using them directly.Rather than making all 146 extended styles available, we use a subset of them via the
extendedVariables
array.CEM Shuffling
Moved
../library/get-parent-class-name.js
out from library and into thecem-analyzer-plugins
directory instead. Figma code is all colocated. CEM plugin code can/should be too?📋 Checklist
🔬 Testing
Review Storybook and see if anything is totally busted. The visual tests failing are expected. Here is a high-level overview of some of the main changes:
line-height
s were removedI've gone through all 377 visual test failures a couple of times now and everything looks expected to me 👍.
📸 Images and videos
Too many to list 😆 ! Viewing the visual test report is a good place to go.