Box Shadow
CSS box-shadow variables
Our styling is done through CSS variables; all our CSS variables can be found here.
Translating the Shadow effects on Figma to CSS variables
Using Figma’s dev mode
Check our documentation on how to inspect Figma files as a Dev and get your CSS vars!
Manually translating a Figma shadow style variable to a CSS variable
We use Style Dictionary to transform design tokens into CSS variables. During this process, the token name gets translated to follow CSS best practices. Below, you can find the process the name undergoes.
First, the slashes in the name are replaced by hyphens, so let’s say a Figma shadow is named
shadow/2_side_panel
Style dictionary will transform those into
shadow-2_side_panel
Then the words in snake case will be transformed into camel case, so following our current example, the output will be
shadow-2SidePanel
After that Style dictionary will add a prefix.
The prefix is composed of the gse acronym and the level of the token, we have 3 main token levels core, semantic, ui. Figuring out to which level the token belongs is a little tricky, so we recommend testing with semantic First, most of the shadow styles accessible to designers are on that level.
So, following the example above, the final name of the variable would look something like this:
--gse-semantic-shadow-2SidePanel
Identifying deprecated shadow styles
Our deprecated shadow styles will include “container” in the name.
Below, you can find some examples:
--gse-semantic-container-lg-boxShadow-offSetX
--gse-semantic-container-sm-boxShadow-offsetY
--gse-semantic-container-md-boxShadow-blur
--gse-semantic-container-lg-boxShadow-spread
--gse-semantic-container-md-boxShadow-color
--gse-semantic-container-sm-boxShadow-type
Updating the deprecated shadow CSS variables
Below you’ll find a table with the deprecated shadow styles and our recommendation on which new styles you should use instead.
The table below covers semantic-level variables, since UI-level variables will update their value automatically with [LIBRARY VERSION].
As mentioned, these recommendations may not entirely match your specific use case. If you want to know more about the new shadow styles, please take a look at our elevation documentation.
|
Deprecated var |
Recommended new var |
|---|---|
|
--gse-semantic-container-lg-boxShadow-* |
--gse-semantic-shadows-5Modal-* |
|
--gse-semantic-container-md-boxShadow-* |
--gse-semantic-shadows-6FloatingMenu-* |
|
--gse-semantic-container-sm-boxShadow-* |
--gse-semantic-shadows-1Card-default-* |
Z-Index
Below, you’ll find our Z index variables available:
|
Variable |
Value |
|---|---|
|
--gse-semantic-elevation-0Page |
0 |
|
--gse-semantic-elevation-1Card |
1 |
|
--gse-semantic-elevation-2SidePanel |
100 |
|
--gse-semantic-elevation-3GlobalNavigation |
200 |
|
--gse-semantic-elevation-4Copilot |
300 |
|
--gse-semantic-elevation-5Shroud |
400 |
|
--gse-semantic-elevation-6Modal |
401 |
|
--gse-semantic-elevation-7Menu |
500 |
|
--gse-semantic-elevation-8DraggedItem |
600 |
|
--gse-semantic-elevation-9Toast |
700 |
|
--gse-semantic-elevation-10Tooltip |
800 |