Tokens Studio for Figma
  • Getting Started
    • Tokens Studio Plugin for Figma
    • Install the Figma Plugin
    • Pro Licence for the Figma Plugin
    • Join the Slack Community
    • Feature Requests - Featurebase
    • Changelog - Featurebase
  • Design Token Fundamentals
    • Intro to Design Tokens
      • Token Anatomy - Type
      • Token Anatomy - Value
      • Token Anatomy - Description
      • Token Anatomy - Name
  • Token Management
    • Token Types
      • Asset
      • Boolean
      • Border - Composite
      • Box Shadow - Composite
      • Color
        • Modified Colors (pro)
        • Gradient Colors
      • Dimension
        • Border Radius
        • Border Width
        • Sizing
        • Spacing
      • Number
      • Opacity
      • Other
      • Text (string)
      • Typography - Composite
        • Font Family
        • Font Weight
        • Font Fallbacks
        • Font Size
        • Line Height
        • Letter Spacing
        • Paragraph Indent
        • Paragraph Spacing
        • Text Case
        • Text Decoration
      • Composition (legacy)
    • Token Values
      • Token Values with References
      • Using Math in Token Values
    • Token Names
      • Token Name Technical Specs
      • Token Groups
      • Edit Token Names
    • Token Description
    • Token Sets
      • JSON View
  • Themes management
    • Themes (pro)
    • Themes that switch
  • Working in Figma
    • Variables and Tokens Studio
    • Styles and Tokens Studio
    • Export to Figma Guide
      • Export Options
      • Export Using Themes (pro)
      • Export Using Token Sets
      • Variables Skipped on Export
      • Styles with Variable References
    • Import from Figma Guide
      • Import Styles from Figma
      • Import Variables from Figma
        • Connect Themes to Imported Variables
        • Imported Variable Types and Token Types
    • Non-local Variables and Styles (pro)
    • Remove Tokens from Figma elements
    • Dev Mode in Figma
  • Settings Management
    • Plugin Settings
    • Base Font Size Setting
    • Token Format - W3C DTCG vs Legacy
  • Token Storage and Sync Integrations
    • Local Document - Figma File Token Storage
      • Figma Data Limits
    • Remote Token Storage Integrations
      • GitHub - Git Sync Provider
      • GitLab - Git Sync Provider
      • Bitbucket - Git Sync Provider
      • Azure DevOps - Git Sync Provider
      • JSONBin - Cloud Sync Provider
      • Supernova - Cloud Sync Provider
      • Tokens Studio Platform - Cloud Sync Provider
      • URL - Server Sync Provider
      • Generic Versioned Storage - Server Sync Provider
    • Multi-file Sync to Remote Storage (pro)
    • Manage Sync Providers
      • Edit Sync Provider
      • Change Active Sync Provider
      • Remove Sync Provider
    • Sync Changes to Remote Storage - Push and Pull
    • Branch Switching (pro) - Version Control
  • Inspect and Debug Tokens
    • Inspect Tokens
    • Remap Tokens
  • Transform Tokens for Development
    • Style Dictionary + SD Transforms
    • Official docs for Style Dictionary
  • Style Dictionary Playground
  • Troubleshooting
    • Reset Tokens from Dev Console
    • Tokens Studio Status
  • Open Source
    • Contribute
    • Shared Plugin Data
Powered by GitBook
On this page
  • Box Shadow - Token Type
  • Design decisions
  • Possible values
  • Values that reference another Token
  • Apply Box Shadow Tokens
  • Effect Styles in Figma
  • W3C DTCG Token Format
  • Transforming Tokens
  • Resources

Was this helpful?

Edit on GitHub
Export as PDF
PreviousBorder - CompositeNextColor

Last updated 4 months ago

Was this helpful?

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


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.

The best practice is to define all parts of a Composite Token, even with a null/none value, rather than to leave it empty.

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.

1

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

2

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

3

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.

4

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

5

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.

Values that reference another Token

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


Apply 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.


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.

Before you export your Box Shadow Tokens to Figma as styles, ensure each property within the Box Shadow Tokens has a value referencing another Token.

When you Export to Figma, select these Options from the menu to create Effect Styles with Variable References:

  • Effect Styles is selected.

  • Number and Color 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)


W3C DTCG Token Format

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 as BoxShadow where the spec writes it as shadow.

    • 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

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.

"object, object"

When you transform your Box Shadow Tokens and they show "object, object", it means your SD-Transforms configuration needs to be adjusted to include "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.

The innerShadow properties need to be transformed to inset to be CSS compatible.


Resources

Mentioned in this doc:

Figma resources:

CSS resources:

Community resources:

  • None yet!

Known issues and bugs

    • UI issue where the dropdown menu needs repositioning.

    • Removing one shadow from a Token with many shadows combined does not remove the deleted shadow from the array in the JSON file.

Requests, roadmap and changelog

    • Alignment with the W3C DTCG format for shadow token type

Similar to how shadows are defined in , you can combine multiple shadows in a single Box Shadow Token. Box shadow Tokens applied to text layers would translate to text-shadow in .

Looking for the Blur Effect in Figma? That's currently a property within our .

Like all Composite Tokens, you may reference an existing Token as the value for each individual property, .

Shadow is an official token type in the in the W3C Design Token Community Group specifications ().

→

→

SD-Transforms -

Style Dictionary -

Design Tokens Community Group -

Design Tokens Community Group -

Design in Figma -

MDN Web Docs -

MDN Web Docs -

Tokens Studio Plugin GitHub -

Importing shadow styles causes the order of shadows to be reversed

TokenDropdown collides in Color input of box shadows

Multiple shadows in Box Shadow tokens -

Change boxShadow values from x and y to offsetX and offsetY

CSS
CSS
Dimension Token
→ Jump to the Dimension Token guide
→ Jump to the Dimension Token guide
→ Jump to the Dimension Token guide
→ Jump to the Dimension Token guide
→ Jump to the Color Token guide
9.5 Shadow
SD-Transforms Read-Me Doc, Using Expand
SD-Transforms Read-Me Doc, Using the preprocessor
→ SD-Transforms ts/shadow/innerShadow
Read Me
https://styledictionary.com/
W3C Draft
9.5 Shadow
Shadow or Blur Effects
Box Shadow
Text Shadow
Open issues for Token Type Box Shadow
#2979
#2796
array bug #2280
#2052
More details on Exporting Box Shadow Tokens to Effect styles below ↓.
as described above ↑

Once a Token has been applied, it will remain attached until you manually remove it.

Page cover image
Creating a new Box Shadow Token in the Tokens Studio Plugin for Figma.
Cover

Box Shadow Tokens can be attached to Effect Styles in Figma.

Once the Box Shadow Token form is open in the Plugin, select the + icon to add an additional shadow to your composition.
With the Box Shadow Token form open in the Plugin, select the reference mode icon button to change its Value input. This allows you to reference another Box Shadow Composite Token as the value.
Select the Export Styles and Variables from the Tokens page to configure the Options.

However, like all Token Types, you can "force" a reference by manually entering the Token Name between curly brackets.

For example {token.name.here}

The value will show a broken reference until the originating Token Set is marked as enabled.

Jump to the guide on Token Values with References by selecting the card below to learn more.

Token Values with References

Jump to the guide on Exporting Tokens to Figma by selecting the card below to learn more.

💡 Something to share?

Export to Figma Guide
Submit it here!

🐞 If you are experiencing an issue not listed here, please reach out to us on the Troubleshooting channel of our , , or send us an email support@tokens.studio

Engineers typically transform Tokens used in code with , which is tool-agnostic. Tokens coming from Tokens Studio require an additional step: , an npm package that prepares Tokens for Style Dictionary.

community Slack
submit it on our feedback tool
Style Dictionary
@Tokens-studio/sd-transforms

💌 Visit to contribute or subscribe to updates.

https://feedback.tokens.studio/