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

Was this helpful?

Edit on GitHub
Export as PDF
PreviousFont SizeNextLetter Spacing

Last updated 4 months ago

Was this helpful?

Line Height - Token Type

Line Height Tokens define the vertical distance of each line of text (related to its font size) as an individual property to be composed within a . It is not intended to be applied to text elements directly.


Design decisions

Line Height, also known as leading, defines the vertical distance of each line of text.

Line Height decisions are typically used to enhance the readability of text.

For example, it's common to use a larger Line Height value for long-form text than a short headline to make paragraphs easier to read.

When we apply a Typography Composite Token to a text layer in Figma, these Line Height values will change the text layer:

  • No changes to the Line Height - normal

    • By default, the system uses the value determined by the typeface it is pared with

    • Example 200%

      • Line Height will be twice as large as the font size no matter what the Font size is

  • Responsive - value in rem

    • Example 2rem

      • A person with a webpage zoomed in will see this Line Height remain twice as large as a font size set at 1rem

  • Fixed - value in px

    • Example 32px

      • Line Height will remain the same even when the Font size changes or the user tries to modify the text using system accessibility features.


Possible values

Like all Tokens defining a dimension design decision, the value of a Line Height 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.

Unless you are choosing to use the "default" value defined by the Font Family, which is commonly referred to as the normal value.

For Line Height Tokens, math might be used to ensure that the bounding box for your text elements always sits on a 4/8 pixel grid.

normal (AUTO)

Figma supports the equivalent of the normal Value in CSS (Figma has this as AUTO).

To write your Line Height Token with this value, it needs to match the following text string, which is case sensitive:

normal

However, if you are Exporting your Typography Tokens to Figma as Styles with Variable references, Figma does not support this string value.

Hard-coded numeric values

The syntax used to write numeric values for the Letter Spacing property is important.

  • Be sure to avoid any spaces between numbers and units of measurement.

  • Units are always written in lowercase.

  • Value should always be greater than 0.

Figma allows values less than 0

Line Height Values less than 0 are not widely supported in CSS and other programming languages. So, while you can enter negative values in the plugin that will communicate with Figma, we don't suggest this without consulting with your engineering team.

Percentage units (%)

To scale the Line Height relative to Font Size the Token value will be defined with a percentage to match Figma's unique approach to typography.

When the Typography Composite Token is applied, the Plugin will apply the percentage as a multiplier of the Font Size.

This is different from the way we would define this relationship in code. In CSS, we might enter this as a unitless number, which Figma does not support as unitless numbers in Figma as assumed to be pixels.

Rem units (rem)

While its not common, you can define your Line Height 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 Line Height Token with a value of 1rem, when applied as a Typography Composite Token, will appear as 16px in Figma.

pixels (px)

While its not common, should you require the line height to remain static even when users change their preferences, the Line Height value can be defined in pixel units. For example:

20px

Be mindful that the fixed value in pixels means the Line Height property is no longer related to the Font Size in the Typography Composite Token. If you change the Font Size, you'll also need to change the Line Height value.

Units not supported by Figma

  • length in cm, pt, etc

  • additional text-strings

    • initial - sets the property to default value

    • inherit - parent element determines the value

You can still create Line Height Tokens with these units using the Tokens Studio plugin.

When you apply them to design elements in Figma, the Token will be present and visible to engineers inspecting the design element in Figma, but the Token won't interact with the Line Height property in Figma's UI.

It will be up to the engineers working to transform the design Tokens in Style Dictionary if they want to transform the values as you've entered them or change them in some way.

Values that reference another Token

When trying to reference another Token as the Value for a Line Height Token, you will seeyou 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 = lineHeights

    • dimension

    • number


W3C DTCG Token Format

Line Height is not yet an official dedicated Token type in the W3C Design Token Community Group specifications.

"The vertical spacing between lines of typography. The value of this property MUST be a valid number value or a reference to a number Token. The number SHOULD be interpreted as a multiplier of the fontSize." - 9.7. Typography

However, Figma doesn't support a unitless number that behaves as a multiplier; it interprets a unitless number as an exact value in pixels.

Token Type syntax

In Tokens Studio, the Line Height Token has a unique syntax in code which identifies if the Token is:

  • An independent property Token

  • Part of a Typography Composite Token

Looking at the JSON format, the "type" is written in plural "lineHeights" when the Font Size Token is defined as an independent property Token.

This example shows a Line Height property Token named line-height-classic with the value in percentage (see line 4).

{
  "line-height-classic": {
    "value": "100%",
    "type": "lineHeights"
  }
}

This is in contrast to the Typography Composite Token, which has the property Token "type" written in the singular "lineHeight".

This example shows a Typography Composite Token with the Font Weight property Token named line-height-classic referenced as the value (see line 6).

{
  "paragraph-3": {
    "value": {
      "fontFamily": "{font-family-sans}",
      "fontWeight": "{font-weight-default}",
      "lineHeight": "{line-height-classic}",
      "fontSize": "{font-size-small}",
      "letterSpacing": "{letter-spacing-tight}",
      "paragraphSpacing": "{paragraphSpacing.none}"
      "paragraphIndent": "{paragraphIndent.none}"
      "textCase": "{textCase.none}",
      "textDecoration": "{textDecoration.none}"
    },
    "type": "typography"
  }
}

Transforming Tokens

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

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

The preprocessor in the SD-Transforms package will automatically convert the Tokens Studio specific Token Type of lineHeights to align with the DTCG Format Token Type of lineHeight.

Line Height Tokens, as part of Typography Composite Tokens, requires the SD-Transforms option to expand composite Tokens into multiple Tokens.


Resources

Mentioned in this doc:

  • Style Dictionary - https://styledictionary.com/

Figma resources:

CSS resources:

Community resources:

  • WHAT - LINK

  • None yet!

Known issues and bugs

Requests, roadmap and changelog

  • None

In this property is called line-height.

Relative to - value in %

There are additional units properties that are not supported in Figma:

However, is mentioned as a required part of a

Tokens Studio has added Line Height as an unofficial Token Type to support Figma's unique approach to this text property which includes the use of percentage units in its value. If your Design Tokens are being used in code, we have included a transformation to correct this inconsistency, .

Line Height Token values entered as a percentage to accommodate Figma's unique approach to Typography need to be converted into a unitless number to match the

→

→

→

SD-Transforms -

Design Tokens Community Group -

Design Tokens Community Group -

Design in Figma -

MDN Web Docs -

W3 Schools -

Tokens Studio Plugin GitHub -

CSS
Font Size
commonly used in CSS for Line Height
typography Token
CSS preferred value for line height.
SD-Transforms Read-Me Doc, ts/size/lineheight
SD-Transforms Read-Me Doc, ts/resolveMath
SD-Transforms Read-Me Doc, Using the preprocessor
Read Me
W3C Draft
9.7 Typography
Explore Text Properties, Line Height
line-height
line-height
Open issues for Token Type Line Height
↓ See the Transforming Tokens section below for more details.
described below ↓
Typography Token

💡 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/
Page cover image
Creating a new Line Height Token in the Tokens Studio Plugin for Figma.
Cover

Line Height Tokens can be attached to Number Variables in Figma.

However, Figma does not support responsive values for Line Height as Number Variables, they only fixed values as Number Variables.

The Typography Composite Token form is open, with each property referencing another Token. The Line Height property is highlighted.

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 .

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.

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.

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.

→

"object, object" When you transform your Typography Tokens and they show "object, object", it means your SD-Transforms configuration needs to be adjusted to include "expand".

plugin settings for Base Font Size
Using Math in Token Values
Token Values with References
Style Dictionary
@Tokens-studio/sd-transforms
SD-Transforms Read-Me Doc, Using Expand