Last updated
Was this helpful?
Last updated
Was this helpful?
Paragraph Spacing Tokens define the vertical distance between 2 paragraphs of text as an individual property to be composed within a . It is not intended to be applied to text elements directly.
Tokens Studio added support for Paragraph Spacing to accommodate Figma's unique way of handling text styles. They use this property to define the vertical distance between 2 paragraphs of text.
When we apply a Typography Composite Token to a text layer in Figma, these Paragraph Spacing values will change the text layer:
Preferred value - 0
No additional space between paragraphs.
A line break would be added to create the space needed instead.
This most closely matches how spacing between paragraphs would be done in code.
Relative to Font Size - value in rem units
Example: Paragraph Spacing at 0.5rem
with Font Size at 1rem
A person who has increased the font size of a mobile phone will see the space between paragraphs half the size of the text.
Fixed - value in pixels
Example 8px
The space between paragraphs will remain the same as a user zooms into a webpage.
Paragraph Spacing Tokens can be attached to Number Variables in Figma.
Like all Tokens defining a dimension design decision, the value of a Paragraph Spacing Token must include a numeric value and, ideally, a unit of measure.
Tokens without a unit specified are applied as the pixel equivalent in Figma.
When writing the hard-coded values for a Paragraph Spacing Token, you'll want to:
Avoid spaces
Include a number and unit of measure.
Values without a unit will be translated to pixels in Figma.
The value should always be greater than 0.
Or use the specified string (below) for the normal
value.
rem units (rem)
To support responsive design, you can define your Paragraph Spacing Token in rem units, and the plugin automatically converts the value to the pixel equivalent when the Typography Composite Token is applied to the text element in Figma.
For example, a Paragraph Spacing Token with a value of 1rem
, when applied as a Typography Composite Token, will appear as 16px
in Figma.
Pixel units (px)
While its not common, should you require the space between every paragraph to remain static even when users change their preferences, the Paragraph Spacing value can be defined in pixel units. For example:
When trying to reference another Token as the Value for a Paragraph Spacing 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 = paragraphSpacing
dimension
number
Paragraph Spacing is not an official token type in the W3C Design Token Community Group specifications.
Tokens Studio has added Paragraph Spacing as an unofficial Token Type to support Figma's unique approach to this text property.
When transforming Paragraph Spacing Tokens, there are specific configurations to be aware of.
The preprocessor in the SD-Transforms package will automatically convert the Tokens Studio specific Token Type of paragraphSpacing
to align with the DTCG Format Token Type of dimension
.
Paragraph Spacing, as part of Typography Composite Tokens, requires the SD-Transforms option to expand composite Tokens into multiple Tokens
.
Mentioned in this doc:
None yet!
None yet
None
This isn't a typical CSS property; you could define it by adding a .
→
SD-Transforms -
Style Dictionary -
Design Tokens Community Group -
Design Tokens Community Group -
Design in Figma - Explore Text Properties,
MDN Web Docs -
Tokens Studio Plugin GitHub -
Rem Units act as a multiplier of the base font size, so when a user changes their preferences to a larger font size or uses a zoom feature in your product, elements defined in rem units will respond accordingly.
The value of 1rem
can be configured in the .
Jump to the guide on Exporting Tokens to Figma 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.
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.
💡 Something to share?
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.
→
🐞 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.