Token Types
Overview of Token Types

Token Types in the Plugin

The Tokens Studio (TS) plugin for Figma supports 24 unique Token Types.

Recall that The type of Design Token defines which category of design property this decision belongs to, or when it can be applied.

Read the Intro to Design Tokens Guide on Token Types for a high-level breakdown.

Terms to be aware of

Across our docs, you'll notice we describe Token Types in different terms.

Official

Unofficial

  • 'Unofficial' Token Types were created by Tokens Studio before the W3C DTCG Specs defined an alternate Token Type.
  • For example, Border Width Token is an unofficial type defined by the spec as a Dimension Token.
  • Tokens Studio will continue to support unofficial Token Types for now. We've already built a conversion into our SD-transforms script; more details are below.
  • Any Token Types we are planning to deprecate will be listed as legacy.

Composite

  • When elements are styled by composing many related design decisions together, they are combined into a Composite Token Type.
  • For example, a Typography Token is composed of 9 independent text-related properties.

Property

  • Each design decision that is a part of the Composite Token is referred to as a Property of their respective Composite Token in our guides.
  • For example, Font Family and Font Weight Tokens are Unofficial Tokens we created to independently define the Properties that Compose a Typography Token.

Compatible

  • A Token Type with properties that is compatible with another Token Type. For example, the dimension Token Type is compatible with fontSize when referenced within a typography Composite Token.
  • Compatible Token Types are visible by default when defining Token Values which reference another Token in the plugin.

Disclaimer on these terms
These descriptive terms are not the only way to describe Token Types; they are the labels the Tokens Studio team uses for simplicity across our documentation. If your team uses different descriptive terms, that's totally okay!

Transforming Tokens

To use Design Tokens in code, engineers need to transform them from their tool/platform-agnostic format to meet their programming needs. Engineers typically transform Tokens used in code with Style Dictionary, which is tool-agnostic and based on the Token Format in the DTCG specifications.

Tokens coming from Tokens Studio require an additional step: @tokens-studio/sd-transforms, an npm package that prepares tokens for Style Dictionary.

Some Tokens we create in Tokens Studio have subtle differences in how the Token type is written compared to the DTCG specifications. In the case of unofficial Token Types, which don't exist in the DTCG spec, we have to transform the TS Type into something Style Dictionary is prepared to work with.

The SD-Transforms package's preprocessor will transform the TS Token Type to the Style Dictionary Type, as described in the table below.

SD-Transforms Read-Me Doc, Using the preprocessor

Available Token Types

Each Token Type has unique properties and specifications, which are documented in detail. Select the common name of the Token Type in the table below to access its docs.

Common NameW3C DTCG OfficialCompositeTechnical Type
TS JSON
Style Dictionary TypeDTCG Type
Color TokenCan be a Property of border, shadowcolorcolorcolor
Typography TokenCompositetypographytypographytypography
Font Family TokenProperty of typographyfontFamilies and fontFamilyfontFamilyfontFamily
Font Weight TokenProperty of typographyfontWeights and fontWeightfontWeightfontWeight
Font Size TokenProperty of typographyfontSizes and fontSizefontSizefontSize
Line Height TokenProperty of typographylineHeights and lineHeightlineHeightNA
Letter Spacing TokenProperty of typographyletterSpacingdimensiondimension
Paragraph Spacing TokenXProperty of typography (in TS, not DTCG)paragraphSpacingdimensiondimension
Text Case TokenXProperty of typography (in TS, not DTCG)textCasetextCaseNA
Text Decoration TokenXProperty of typography (in TS, not DTCG)textDecorationtextDecorationNA
Dimension TokenCan be a Property of border, shadow, typographydimensiondimensiondimension
Number Tokennumbernumbernumber
Border TokenCompositeborderborderborder
Box Shadow TokenCompositeboxShadowshadowshadow
Border Radius TokenXborderRadiusdimensiondimension
Border Width TokenXborderWidthdimensiondimension
Spacing TokenXspacingdimensiondimension
Sizing TokenXsizingdimensiondimension
Asset TokenXassetassetNA
Boolean TokenXbooleanbooleanNA
Text TokenXtextcontentNA
Other TokenXotherotherNA
Opacity TokenXopacityopacityNA
Composition TokenXcompositioneach type in the composition is added individuallyNA

Related topics

Curious about the other anatomic parts of a Design Token, like Name, Value and Description?

Read the Intro to Design Tokens Guide

Curious about how the Token Types attach to Styles and Variables in Figma?

Jump to Export to Figma - Overview

Resources

Mentioned in this doc:

Community resources:

  • None yet!

💡 Something to share? Submit it here!

Known issues and bugs

Tokens Studio Plugin GitHub - Open issues for Transforming Token Types

Tokens Studio Plugin GitHub - Open issues for Token Type Support

  • Remove composition tokens #2800

🐞 If you are experiencing an issue not listed here, please reach out to us on the Troubleshooting channel of our community Slack, or submit it on our feedback tool.

Requests, roadmap and changelog

💌 Visit https://feedback.tokens.studio/ to contribute or subscribe to updates.

Last updated on December 12, 2024