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
  • Number - Token Type
  • Design decisions
  • Possible values
  • Values that reference another Token
  • Apply Number Tokens
  • W3C DTCG Token Format
  • Transforming Tokens
  • Resources

Was this helpful?

Edit on GitHub
Export as PDF
PreviousSpacingNextOpacity

Last updated 4 months ago

Was this helpful?

Number - Token Type

Number Tokens define the numeric value of several design properties that don't require a unit of measurement.

The primary difference between a Number Token and a Dimension Token is a unit of measurement.

  • Number tokens are intended to be unitless.

    • For example: 4

  • Dimension Tokens are required to have a unit of pixels or rem.

    • For example: 4px


Design decisions

The Number Token is used for design decisions with a numeric value that doesn't benefit from a unit of measurement. For example:

  • Math equations to create scales

  • A -90 degree rotation of an image filling the background of a hero section of a website.

Number Tokens can define these design properties in Figma; however, many of these properties benefit from a unit of measurement, and a Dimension Token is preferred:

  • rotation

  • background blur

  • absolute position location

  • size (Dimension Token preferred)

  • space (Dimension Token preferred)

  • border-radius and width (Dimension Token preferred)


Possible values

Hard-coded values

The syntax used to write numeric values for Number Tokens is important.

Number Tokens require a unitless number as the value. For example:

16

A number with a unit should not be used. For example: 16px

Values that reference another Token

When trying to reference another Token as the Value for a Number Token, you will see Tokens in the dropdown list that are:

  • Living 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:

    • The same = number

Compatible Token Types

After you've created Number Tokens, they can be referenced in another Number Token and several compatible Token Types.

See all Token Types compatible with Number Tokens

Typography - Composite

Font Size

Paragraph Spacing

Border - Composite

Spacing

Sizing

Border Radius

Border Width


Apply Number Tokens

A Number Token can define the numeric value of several design properties when applied to frames, groups or graphic elements in Figma.

With one or more elements selected in Figma, right-click on the Number Token Name in the Plugin to see the design property options.

Select your desired design property by clicking on it to apply the Tokens value instantly.

If you click to apply this Token to an element without accessing the right-click Token menu, the value will be applied as a spacing-gap property.

1. Spacing

The spacing property defines the distance between layers of an auto-layout frame in Figma when the Number Token is applied.

For independent styling per side, you can repeat the steps above and apply different Number Tokens to each position of the same design element.

If you apply the Token to a frame before auto-layout is applied in Figma, you may have to remove and re-apply the Token after auto-layout has been enabled for the Token Value to apply as expected.

2. Sizing

The Sizing property defines the width or height of polygonal shape, frames, groups or graphic elements in Figma when the Number Token is applied.

For independent styling per side, you can repeat the steps above and apply different Number Tokens to each position of the same design element.

If you apply the Token as Min/Max Width or Height to a frame before auto-layout is applied in Figma, you may have to remove and re-apply the Token after auto-layout has been enabled for the Token Value to apply as expected.

3. Border Radius

The Border Radius property defines the corner roundness of polygonal shape, frames, groups or graphic elements in Figma when the Token is applied.

For independent corner styling, you can repeat the steps above and apply different Number Tokens to each corner position of the same design element.

4. Border Width

A Border Width property defines the thickness of the stroke applied to text layers, polygonal shapes, frames, groups or graphic elements in Figma when the Number Token is applied.

For independent border styling, you can repeat the steps above and apply different Number Tokens to each side of the same design element.

If you apply the Border Width property to an element before a stroke is applied in Figma, you may have to remove and re-apply the Dimension Token after the stroke has been enabled for the value to apply as expected.

5. Background Blur

The Background Blur property of the Number Token defines the intensity of the Layer Blur Effect in Figma when the Token is applied in Figma.

The Background Blur property must be applied to container design elements, like frames, groups, and polygonal shapes with a reduced opacity color fill applied.

6. X and Y Position

The x position and y position properties of the Number Token define the absolute position of the design element when the Token is applied in Figma.

X Position

  • The element is absolutely positioned on the horizontal axis in relationship to the parent container.

  • If no parent container is present, it positions the element on the Figma canvas.

Y Postion

  • The element is absolutely positioned on the vertical axis in relationship to the parent container.

  • If no parent container is present, it positions the element on the Figma canvas.

If you apply the x/y property to an element before enabling Absolute Position and Auto-layout in Figma, you may have to remove and re-apply the Dimension Token after they are enabled before the value will be applied as expected.

7. Rotation

The rotation property defines the numeric degree of rotation on its access when the Number Token is applied to any design element in Figma.

This means you can assign negative values to control the direction of rotation.


W3C DTCG Token Format

Number is an official Token type in the W3C Design Token Community Group specifications.

Tokens Studio has approached Number Tokens differently than how it is defined in the current W3C spec to align with Figma's number variables more closely.

However, we will be iterating on Number Tokens in the near future to more closely align with the W3C DTCG specifications.

  • We allow a unit in a Number Token (this will change).

  • We allow a Number Token to be used with many of the same properties the specification defines as requiring a Dimension Token.

  • We don't yet require a Number Token in all use cases the spec defines it as a requirement, such as a "gradient stop position."

Number Tokens are a relatively new addition to the W3C DTCG specification, which defines this Token as being applied to many different design properties.

If we want to fully align with the spec, it requires Tokens Studio to phase out several unofficial Token we introduced long before the Number Token was added to the spec:


Transforming Tokens

When transforming Number Tokens, there are specific configurations to be aware of.

Token Values entered as a number without a unit converted to a number with pixels as a unit.

Token Values entered with math equations need to be checked and resolved.

Running the SD-Transforms pre-processor as part of the generic package will prep your Number Tokens for Style Dictionary.


Resources

Mentioned in this doc:

Figma resources:

CSS resources:

Community resources:

  • None yet!

Known issues and bugs

  • None yet

Requests, roadmap and changelog

  • None

According to the , the value of a Number Token must be a unitless number.

Color Tokens with

You can also reference a Number Token in these additional Token Types; however, they are not recognized in the W3C DTCG specifications as official Token Types, .

→

→

The plugin supports a that allows you to reference a Border Width Token to avoid this issue.

→

to learn about reduced opacity colors using color spaces that support alpha.

This property can't yet be Exported to Figma as a reusable Effect Style from the plugin in the same way that can.

→

"Represents a number. Numbers can be positive, negative and have fractions. Example uses for number Tokens are or unitless line heights. The $type property MUST be set to the string number. The value MUST be a JSON number value." -

→

→

→

SD-Transforms -

Style Dictionary -

Design Tokens Community Group -

Design Tokens Community Group -

Design in Figma -

Design in Figma -

Design in Figma -

Design in Figma -

Design in Figma -

MDN Web Docs -

Tokens Studio Plugin GitHub -

Read Figma's doc on Autolayout here
Read Figma's doc on Autolayout here
Border Composite Token
Read Figma's doc on Layer blur here
→ Jump to the guide on Color Tokens
Box Shadow Tokens
→ Read Figma's docs on Absolute Position
Read Figma's docs on Rotation here
gradient stop positions
8.7 Number, DTCG Specifications on W3C
Spacing
Sizing
Border Radius
Border Width
SD-Transforms Read-Me Doc, ts/size/px
SD-Transforms Read-Me Doc, ts/resolveMath
SD-Transforms Read-Me Doc, Using the preprocessor
Read Me
https://styledictionary.com/
W3C Draft
8.7 Number
Explore autolayout properties
Apply and adjust stroke properties
Adjust corner radius and smoothing
Adjust alignment, rotation, and position
Apply blur effect
Number
Open issues for Token Type Number
W3C DTCG specification
more details below ↓

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.

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.

All Token Types that accept numeric values can use math equations to calculate their value in Tokens Studio.

Jump to the guide on Tokens with Math Values by selecting the card below to learn more.

Token Values with References
Style Dictionary
@Tokens-studio/sd-transforms
Using Math in Token Values

💡 Something to share?

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

community Slack
submit it on our feedback tool

💌 Visit to contribute or subscribe to updates.

https://feedback.tokens.studio/
Reduced opacity (transparency)
1

Gap

Apply the Token value to the space between child elements within an auto-layout frame.

2

All

Apply the Token value to padding on all sides of the parent container, and the space between child elements within an auto-layout frame.

3

Horizontal padding

Apply the Token value to the space between the border and child elements on the left and right sides an auto-layout frame.

4

Vertical padding

Apply the Token value to the space between the border and child elements on the top and bottom sides an auto-layout frame.

5

Row Gap

Apply the Token value to the space between rows of child elements in auto-layout frames set to wrap.

6

Top

Apply the Token value to padding on the highest side of an auto-layout frame on the X-axis only.

7

Right

Apply the Token value to padding on the right side of an auto-layout frame on the y-axis only.

8

Bottom

Apply the Token value to padding on the lowest side of an auto-layout frame on the X-axis only.

9

Left

Apply the Token value to padding on the left side of an auto-layout frame on the y-axis only.

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

Number Tokens can be attached to Number Variables in Figma.

The right-click menu and sub-menus of a Number Token are opened to reveal the design properties it can be applied to in Figma.

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

1

All

Apply the Token value to the roundness of all corners of the selected design element.

2

Top left

Apply the Token value to the roundness of the corner on the left highest side of the element on the X-axis only.

3

Top right

Apply the Token value to the roundness of the corner on the right highest side of the element on the X-axis only.

4

Bottom right

Apply the Token value to the roundness of the corner on the left lowest side of the element on the X-axis only.

5

Bottom left

Apply the Token value to the roundness of the corner on the right lowest side of the element on the X-axis only.

1

All

Apply the Token value to the roundness of all corners of the selected design element.

2

Top left

Apply the Token value to the roundness of the corner on the left highest side of the element on the X-axis only.

3

Top right

Apply the Token value to the roundness of the corner on the right highest side of the element on the X-axis only.

4

Bottom right

Apply the Token value to the roundness of the corner on the left lowest side of the element on the X-axis only.

5

Bottom left

Apply the Token value to the roundness of the corner on the right lowest side of the element on the X-axis only.

1

All

Apply the Token value to the horizontal and vertical size of the design element.

2

Width

Apply the Token value to the horizontal size of the design element only.

3

Height

Apply the Token value to the vertical size of the design element only.

4

Min Width

Apply the Token value to set the smallest allowed horizontal size of an auto-layout frame.

5

Max Width

Apply the Token value to set the largest allowed horizontal size of an auto-layout frame.

6

Min Height

Apply the Token value to set the smallest allowed vertical size of an auto-layout frame.

7

Max Height

Apply the Token value to set the largest allowed vertical size of an auto-layout frame.

There is no immediate plan to discontinue support of unofficial Token Types.

We want to build a thoughtful solution to help Tokens Studio users migrate from these 'unofficial Token Types' to Dimension Tokens if that time comes.

→

Conversation forum on Unofficial Token Types is here.

→ Jump to the Dimension Token technical docs by selecting the card below.

Dimension