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
    • 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
  • Design Token Name Technical Specifications
  • Tokens are case sensitive
  • Tokens can be grouped by Name
  • Reserve periods for creating groups
  • Token names are modified by engineers
  • Names act as the unique ID for each design decision
  • Things to avoid
  • Resources

Was this helpful?

Edit on GitHub
Export as PDF
PreviousToken NamesNextToken Groups

Last updated 3 months ago

Was this helpful?

Design Token Name Technical Specifications

The name of a Design Token acts as the unique identification for our design decisions in code.

While naming is a personalized part of working with Design Tokens, we've compiled guidelines to avoid common naming errors that cause technical issues for engineers.

This information is based on:

Knowing how things work "under the hood" can help you make better choices when choosing names for Tokens to avoid errors when your Tokens are used in code.

While there aren't official specifications for naming Token Sets, the same best practices for naming your Tokens will also apply to naming your Token Sets.


Tokens are case sensitive

Tokens with the same names but different uses of capital letters will be seen in the system as unique Design Tokens.

For example, all of these Tokens would be viewed as unique Tokens by a back-end system: tokenName tokenname Tokenname TokenName

You'll want to decide on a casing strategy for your Token's names and stick with it.

Tokens can be grouped by Name

The period (.) character is used to create Groups of Tokens. Grouping Tokens helps to organize your Tokens into a tree structure in your design tools and code files.

You can think of the Groups in Token Names as a folder system for your design decisions.

For example, these Color Tokens do not have any grouping, also known as Flat names:

colors-green-100
colors-green-200
colors-green-300

Compared to grouped names, which replaces the dash (-) with a period (.):

colors.green.100
colors.green.200
colors.green.300

These 3 Tokens would end up being grouped in JSON file:

{
  "colors": {
    "green": {
      "100": {
        "value": "#0e1512",
        "type": "color"
      },
      "200": {
        "value": "#121b17",
        "type": "color"
      },
      "300": {
        "value": "#132d21",
        "type": "color"
      }
    }
  }
}
```

Reserve periods for creating groups

When creating your Token names, be sure to use period (.) where you want to create a Group and not to represent the identification of a design decision.

This is a common mistake when creating Token Names for dimension properties where a scale needs a half or quarter step.

For example, a half step between spacing.1 and spacing.2 is commonly written as spacing.1.5 or spacing.1-5

However, both of these options are less than ideal once we pass our Tokens over to engineers who modify our Token Names as a part of the Transformation process.


Token names are modified by engineers

During the transformation process, they often modify the Token names to match their preferred workflow.

Most common Token name modifications:

  • Change casing and punctuation.

  • Flatten them to remove groups.

  • Add or remove front matter/prefixes.

  • Remove designer-specific words.

For example, if the engineer writes their code in camelCase, your Design Tokens would change:

  • Original: my-awesome-token

  • Transformed: myAwesomeToken

So when you write your Token names in the plugin without any issues, once engineers modify them, there could be multiple tokens with the same name.

This could be a problem that causes naming collisions because your engineer no longer has a unique ID for each design decision.

Original Name
Flattened Name

spacing.1.5

spacing15

spacing.1-5

spacing15

spacing.15

spacing15

Names act as the unique ID for each design decision

It's important to be thoughtful with your naming structure to ensure each Design Token has a unique name, which acts as the identifier for a specific design decision.

If there are more than one identical Token names with different values, the system doesn't know which ID to pay attention to.

This is called a naming collision, which can be intentional.

In the case of theming, we have multiple Token sets containing Tokens with identical names but different values. We tell the system which theme is active, and it overrides all Tokens with the chosen values.

For example, a person selects dark mode on a website and all the components are styled based on the dark-theme Tokens in the backend.

This can also be unintentional.

The spacing Tokens from the earlier example might be written like this in Tokens Studio:

spacing.1
spacing.1-5
spacing.2
...
spacing.15

When flattened by engineers to remove dashes (-) and periods (.) in the transformation process, it would result in these Token Names:

spacing1
spacing15
spacing2
...
spacing15

Which causes a naming collision for spacing15.

So, to avoid this issue when working with numeric scales, you could write the name of the fraction as a string.

For example, spacing.1-5 could be spacing.1half.

When the same Tokens from above are flattened, they would appear as:

spacing1
spacing1half
spacing2
...
spacing15

Things to avoid

When creating your Token Names, you'll want to avoid strings that are considered "forbidden" because they can cause destructive issues in code.

Forward slash - /

In Tokens Studio, when you use a period (.) to create token groups and export them to Figma, the plugin converts the period to forward slash (/) to create the same groups in Figma automagically.

So, to avoid creating unintentional groups in Figma, do not use forward slashes (/) when writing your Token names.

When naming a Token Set, this rule does not apply. In the Tokens Studio plugin for Figma if you name your Token Sets with a / , the / creates the group, or folder structure for your JSON files.

Dollar sign - $

In your Token JSON files, an object with the dollar sign has an assigned property in the Design Tokens spec, typically the parts identified in the Anatomy of a Design Token (more on that below).

Examples:

  • "$description" denotes the property of token description

  • "$type" denotes the type of token

This means that Token names can't begin with the $ character but could technically exist in other parts of the name. We suggest you avoid it whenever possible to avoid complications in code.

Names that match Token anatomy

Avoid using names that match the official anatomic parts of a Token, as these specific strings of text are reserved for functional logic when using Tokens in code:

  • name

  • type

  • value

  • description

One of the most common errors in naming Tokens happens with Typography design decisions being shortened to include the word type as a shortform for Typography.

Curly brackets - { }

Curly brackets are used to identify Tokens with Values that reference another Token. #add-doc-link/token-values-references

Example: "$value": "{green-500}"

So if they are also in a Token Name it totally breaks the code. This is common when folks are trying to reference a keyword in a Token Name by using curly brackets, which is a clever idea, but problematic for the plugin to process and for engineers to work with.

Square and round brackets - [ ] ( )

Much like the curly brackets, square and round brackets are often used in code, and when we include them in our Token names it leads to undesirable results.

Special characters, emojis and spaces - 😳

When transforming tokens in code, using spaces, emoji or special characters can cause problems and a lot of unnecessary custom transformations to fix.

This issue often happens when importing Styles or Variables from Figma into the Plugin. While designers might find adding emoji's and special characters to their Figma workflow, they are not suitable for use in Design Tokens, which are technically code.


Resources

Mentioned in this doc:

Figma resources:

Community resources:

  • None yet

Known issues and bugs

Requests, roadmap and changelog

  • None yet

outlined in the latest W3C draft by the Design Tokens Community Group.

The most common issues with Token Names while transforming for code provided by the engineering team.

In Tokens Studio, there are workflow features for which allow you take bulk actions on an entire Group (any any subgroups).

Engineers use a tool like to transform Design Tokens into whatever specific formats they need.

Figma uses the forward slash to create groups and folders to organize , and

: "...token and names MUST NOT begin with the $ character."

SD-Transforms -

Style Dictionary -

Design Tokens Community Group -

Design Tokens Community Group -

Design Tokens Community Group -

Figma -

Figma -

Figma -

Tokens Studio Plugin GitHub -

Technical specifications
Style Dictionary
Token Groups
Style Dictionary
components
styles
variables
The DTCG Spec states
group
Read Me
https://styledictionary.com/
W3C Draft
W3C Draft, 5.1 Name and Value
W3C Draft, 3.7 Group
Name and Organize Components
Manage and Share Styles
Create and Manage Variables
Open issues for Token Names
In this infographic, the Token examples on the right side highlight the Name. The top code block shows a Token Name with groups. The bottom code block shows a flat Token Name.
Page cover image

🐞 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

community Slack
submit it on our feedback tool

💡 Something to share?

Submit it here!

💌 Visit to contribute or subscribe to updates.

https://feedback.tokens.studio/