Box Shadow - Token Type
Add elevation and depth to design elements by composing several shadow-related design decisions into a single Box Shadow Token.
Each design decision (color, spread, blur, offeset) that is a part of a Composite Token is referred to as a property of the Box Shadow Token in our guides.

Design decisions
While the Token Type label is specific to Box Shadow, this Token supports Inner Shadow and Drop Shadow design decisions.
Each property composed to create the shadow can be defined as it's own Token and referenced within the Box Shadow Composite Token:
X
Y
Blur
Spread
Shadow color
Similar to how shadows are defined in CSS, you can combine multiple shadows in a single Box Shadow Token. Box shadow Tokens applied to text layers would translate to text-shadow
in CSS.
Looking for the Blur Effect in Figma? That's currently a property within our Dimension Token.
Possible values
Like all Composite Tokens, you define the value of each property individually.
When you create the Box Shadow Token in the plugin, you can reference each Token you've already created as a property or enter a hard-coded value.
Hard coded values
In the plugin, use the UI button to select between drop shadow
or inner shadow
.
The dedicated Token Type of each property within the Box Shadow Token has unique specifications, described in detail in their own technical docs.
X-offset
X defines the horizontal position of the shadow and are written as a numeric value and unit of measurement.
Positive values move the position to the right. For example
15px
Negative values move the position to the left. For example
-0.255px
Y-offset
Y defines the vertical position of the shadow and are written as a numeric value and unit of measurement.
Positive values move the position higher up. For example
1.5px
Negative values move the position lower down. For example
-10px
Blur radius
Blur defines the the softness of the shadow edges and is written as a numeric value and unit of measurement.
Higher values create a more diffused shadow, making the edges softer and less defined. For example
15px
A value of
0
creates a sharp shadow edge.
Spread radius
Spread defines the size of the shadow and is written as a numeric value and unit of measurement.
Positive values expand the shadow, making it larger. For example
5px
Negative values shrink it, making it smaller. For example
-2.25px
Color
Color defines the color of the shadow as a solid, reduced opacity, or modified color value written in any color space supported by a Color Token.
You can also use the color picker to create the value by selecting the swatch to the left of the input.
Multiple layers
You can add another shadow layer to the current token by selecting the plus icon button in the Box Shadow Token form.

When you apply the Box Shadow Token to your design element in the Figma UI, you will see multiple shadow effects applied, one for each shadow layer you created within your token.
When you export a multiple-layer Box Shadow Token to Figma as a Style, you will see a single Effect Style applied, with multiple shadow effects within its value.
More details on Exporting Box Shadow Tokens to Effect styles below ↓.
Values that reference another Token
Like all Composite Tokens, you may reference an existing Token as the value for each individual property, as described above ↑.
If you'd prefer to reference an existing Box Shadow Composite Token as the value instead of defining each Property, select the Token's Reference mode button (2x2 circle icon).

When trying to reference another Token as the Value for a Box Shadow Token, you will see Tokens in the dropdown list that are:
Lving in Token Sets that are currently active.
In the left menu on the plugin's Tokens page, a checkmark is visible next to the Token Set name.
Token Type is compatible:
boxShadow
However, like all Token Types, you can "force" a reference by manually entering the Token Name between curly brackets.
For example {token.name.here}
Jump to the guide on Token Values with References by selecting the card below to learn more.
Token Values with ReferencesApply Box Shadow Tokens
Box Shadow Tokens defines the inner or outer shadow styling of text, polygonal shape, and frame layers in Figma when the Token is applied.
With one or more elements selected in Figma, click on the name of your chosen Box Shadow Token in the Plugin to instantly apply its value.
Once a Token has been applied, it will remain attached until you manually remove it.
Effect Styles in Figma
Box Shadow Tokens can be attached to Effect Styles in Figma. Tokens Studio also supports Styles with Variable References.
Here are some tips for creating Effect Styles with Variable References using the Plugin.
When you Export to Figma, select these Options from the menu to create Effect Styles with Variable References:
Effect Styles
is selected.Number
andColor Variables
are selected.Create styles with variable references
is selected.

Ensure your Export to Figma as Themes or Sets configuration includes all necessary Tokens.
Themes and token sets where the referenced Tokens are located are
active
.Themes and token sets where the variables are attached may need to be configured as
reference only
.
You'll notice the Effect Style will be created on Export, with all possible values mapped to the appropriate Variables, based on the Token Type for each property:
color
(will create as color variable)dimension
(number variable)number
(number variable)
Jump to the guide on Exporting Tokens to Figma by selecting the card below to learn more.
Export to Figma GuideW3C DTCG Token Format
Shadow is an official token type in the in the W3C Design Token Community Group specifications (9.5 Shadow).
The plugin had Box Shadow support long before the spec defined the shadow
token, and as a result, we have some legacy decisions which do not completely align with the DTCG spec.
We write the
type
asBoxShadow
where the spec writes it asshadow
.When you run the SD-Transforms npm package we will adjust this automatically to match the specification, details below.
The Plugin currently supports
number
Tokens in numeric value properties.The spec requires
dimension
values only.
Transforming Tokens
Engineers typically transform Tokens used in code with Style Dictionary, which is tool-agnostic. Tokens coming from Tokens Studio require an additional step: @Tokens-studio/sd-transforms, an npm package that prepares Tokens for Style Dictionary.
When transforming Box Shadow Tokens, which are a Composite Token there are specific configurations to be aware of.
Composite Tokens require the SD-Transforms option to expand composite Tokens into multiple Tokens
.
Make sure you look at the generic SD-Transforms package to include this option, which allows you to further customize this transformation further using Style Dictionary.
→ SD-Transforms Read-Me Doc, Using Expand
The preprocessor in the SD-Transforms package will automatically convert the Tokens Studio specific Token Type of boxShadow
to align with the DTCG Format Token Type of shadow
.
→ SD-Transforms Read-Me Doc, Using the preprocessor
The innerShadow
properties need to be transformed to inset
to be CSS compatible.
→ SD-Transforms ts/shadow/innerShadow
Resources
Mentioned in this doc:
SD-Transforms - Read Me
Style Dictionary - https://styledictionary.com/
Design Tokens Community Group - W3C Draft
Design Tokens Community Group - 9.5 Shadow
Figma resources:
Design in Figma - Shadow or Blur Effects
CSS resources:
MDN Web Docs - Box Shadow
MDN Web Docs - Text Shadow
Community resources:
None yet!
💡 Something to share? Submit it here!
Known issues and bugs
Tokens Studio Plugin GitHub - Open issues for Token Type Box Shadow
Importing shadow styles causes the order of shadows to be reversed #2979
TokenDropdown collides in Color input of box shadows #2796
UI issue where the dropdown menu needs repositioning.
Multiple shadows in Box Shadow tokens - array bug #2280
Removing one shadow from a Token with many shadows combined does not remove the deleted shadow from the array in the JSON file.
🐞 If you are experiencing an issue not listed here, please reach out to us on the Troubleshooting channel of our community Slack, submit it on our feedback tool, or send us an email [email protected]
Requests, roadmap and changelog
Change boxShadow values from x and y to offsetX and offsetY #2052
Alignment with the W3C DTCG format for
shadow
token type
💌 Visit https://feedback.tokens.studio/ to contribute or subscribe to updates.

Last updated
Was this helpful?