-
Notifications
You must be signed in to change notification settings - Fork 152
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
New shadow tokens #4439
New shadow tokens #4439
Conversation
Storybook staging is available at https://kiwicom-orbit-marco-shadow-tokens.surge.sh |
Size Change: +190 B (+0.04%) Total Size: 446 kB
ℹ️ View Unchanged
|
Deploying orbit with Cloudflare Pages
|
f3aeccf
to
3cd93bf
Compare
e7b0a04
to
1cb1404
Compare
96f90fa
to
38af8f1
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.
Besides the comments made, we need to update the migration guide and the occurrences of the tokens in the docs package
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 should also update the unit tests that assert that the elevation
prop applies the correct values to the CSS variable
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 have this file called SCHEMA.md
under docs
in this package that should be updated (and also for the other tokens 🫣)
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 updated it (only shadows)
@@ -166,7 +166,7 @@ const PopoverContentWrapper = ({ | |||
"h-auto w-full", | |||
"z-[1000]", | |||
"box-border", | |||
"shadow-raised-reverse", | |||
"shadow-level3-reverse", | |||
"bg-elevation-raised-reverse", |
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.
How are we addressing these? This shadow will disappear but the bg-color remains? Should we deprecate it as well and just use the color directly? In this case, it would be just bg-white-normal, no?
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, backgrounds are still missing.. I need to tackle this and probably just use the replacement (white normal as you suggested).
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 see you kept the tokens or renamed them accordingly. I'm ok with that, but I had suggested to completely get rid of those tokens and use the palette directly.
In this case we would use bg-white-normal
instead of bg-elevation-raised-reverse
that has the value of white.
And btw, raised reverse is deprecated, so this needs to be updated to bg-level3-reverse
, right?
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'm removing tokens and using bg-white-normal
38af8f1
to
b2c1f90
Compare
"category": "Colors", | ||
"version": "9.0.0" | ||
}, | ||
"elevationActionBoxShadow": { |
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 have just realized we now have two levels of deprecations 🤦♂️
The token boxShadowAction
is deprecated and suggests elevationActionBoxShadow
as replacement. But now elevationActionBoxShadow
is also deprecated and suggests elevationLevel1BoxShadow
as replacement.
I am not entirely sure about how this will impact the breaking change, but for instance, I see the boxShadowAction
(the double deprecated one) is currently being used here… 😬 The same for modal-scrolled
and modal
defined right below: they're also using doubly deprecated tokens.
So, yes, I honestly don't know what to do with these. But I'd recommend going through all the tokens (even the older ones) and replace them for the new ones. For example, in that case, replace that switch
definition by the correct elevationLevel1BoxShadow
token (although I'm also not sure about the consequences of such change…)
I did the quick exercise of completely deleting the tokens and the only place where the build failed was the file mentioned above, but I am not 100% sure this is all the confidence we need.
@@ -166,7 +166,7 @@ const PopoverContentWrapper = ({ | |||
"h-auto w-full", | |||
"z-[1000]", | |||
"box-border", | |||
"shadow-raised-reverse", | |||
"shadow-level3-reverse", | |||
"bg-elevation-raised-reverse", |
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 see you kept the tokens or renamed them accordingly. I'm ok with that, but I had suggested to completely get rid of those tokens and use the palette directly.
In this case we would use bg-white-normal
instead of bg-elevation-raised-reverse
that has the value of white.
And btw, raised reverse is deprecated, so this needs to be updated to bg-level3-reverse
, right?
"raised-reverse": { | ||
"background": { | ||
"type": "color", | ||
"category": "elevation", | ||
"value": "{foundation.palette.white.normal}", | ||
"deprecated": true, | ||
"deprecated-replace": "{foundation.palette.white.normal}", | ||
"deprecated-version": "9.0.0" |
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.
Following my previous comment…
I see this is being deprecated with the replacement pointing to palette.white.normal
. But then the level3-reverse
background color is also being created, with the value of palette.white.normal
.
So I think we are not going through the correct approach. We either:
- Use
level3-reverse
as a replacement here and usepalette.white.normal
as a value there
OR
- Use
palette.white.normal
as a replacement here but do not definelevel3-reverse
at all
I personally prefer the second option, as it will remove the overdefinition of tokens entirely. But I am open for discussing (and accepting) the first option as well
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.
Ok, gotcha, I'll remove the background tokens and adapt things accordingly. For some reason, I thought we wanted to keep backgrounds as well but I see they are barely used, so there's no point.
<Box borderRadius="small" elevation="action">"small" borderRadius</Box> | ||
<Box borderRadius="normal" elevation="raised">"normal" borderRadius</Box> | ||
<Box borderRadius="large" elevation="raisedReverse">"large" borderRadius</Box> | ||
<Box borderRadius="circle" elevation="overlay">"circle" borderRadius</Box> |
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.
Given that the content is no longer just about border radius…
<Box borderRadius="small" elevation="action">"small" borderRadius</Box> | |
<Box borderRadius="normal" elevation="raised">"normal" borderRadius</Box> | |
<Box borderRadius="large" elevation="raisedReverse">"large" borderRadius</Box> | |
<Box borderRadius="circle" elevation="overlay">"circle" borderRadius</Box> | |
<Box borderRadius="small" elevation="action">…</Box> | |
<Box borderRadius="normal" elevation="raised">…</Box> | |
<Box borderRadius="large" elevation="raisedReverse">…</Box> | |
<Box borderRadius="circle" elevation="overlay">…</Box> |
And same for the example below
10ea1e9
to
beca013
Compare
I have merged the base branch to master and now I see there are some conflicts. Let me know if you wanna pair so we are sure nothing is missed 🤞 |
- New tokens: level1, level2, level3, level3-reverse, level4 - Deprecated tokens: action, action-active, raised, raised-reverse, overlay
New classes: - shadow-level1, shadow-level2, shadow-level3, shadow-level3-reverse, shadow-level4 Deprecated: - shadow-action, shadow-action-active, shadow-raised, shadow-raised-reverse, shadow-overlay - bg-elevation-action, bg-elevation-action-active, bg-elevation-raised, bg-elevation-raised-reverse, bg-elevation-overlay
b2c1f90
to
ae7cc33
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.
Good work 💪
https://skypicker.slack.com/archives/C7T7QG7M5/p1721117646848839?thread_ts=1720790040.455089&cid=C7T7QG7M5
Closes FEPLT-2064