Last updated
Was this helpful?
Last updated
Was this helpful?
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
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)
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
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
After you've created Number Tokens, they can be referenced in another Number Token and several compatible Token Types.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
Mentioned in this doc:
None yet!
None yet
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 -
Once a Token has been applied, it will remain attached until you manually remove it.
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.
🐞 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
💌 Visit to contribute or subscribe to updates.
💡 Something to share?
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.
→ Jump to the Dimension Token technical docs by selecting the card 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}
Jump to the guide on Token Values with References by selecting the card below to learn more.