Mastering typography in design systems with semantic tokens and responsive scaling | by Oluwatosin Obalana | Mar, 2025

Published on:

Applying semantic labels for hierarchical text styles

Once you’ve defined your type role (Display, Heading, Subheading, Body, Caption, Label), the next step is to apply type scales using semantic labels such as XL, L, M, and S. These labels indicate different size variations within each category, allowing for a more granular control over your typographic hierarchy. By assigning these size-based semantic labels to your text elements, you ensure that each component reflects its relative importance and role within the overall layout, while also offering flexibility in visual emphasis.

For instance, within the Display category, you might have:

  • Display-XL: For the most impactful, attention-grabbing text. Think of the main title on your page.
  • Display-L: For slightly less prominent display text.

Similarly, within the Heading category, you could have:

  • Heading-L: For primary section titles.
  • Heading-M: For slightly less important headings.

And for Body text:

  • Body-M: For your standard paragraph text.
  • Body-S: For smaller body text variations.

This systematic approach not only reinforces consistency across your design by using a defined set of sizes but also streamlines the implementation process for designers and developers.

Here’s a detailed process for setting up semantic typography tokens in Figma:

1. Create the semantic type category

Start by defining a semantic type category to house all typography-related variables. This category should include predefined responsive breakpoints for desktop, tablet, and mobile, as modes ensuring typography scales seamlessly across different devices.

Screenshot of a figma menu with the “Semantic Type” category created and highlighted

2. Define the font name variable

Within the semantic type category, add a string variable for the font family. This variable should reference your primitive token for the font name and should be applied across all breakpoints.

Screenshot showing a “Family” semantic type variable referencing the “Satoshi” primitive token for Desktop, Tablet, and Mobile.

3. Organize by type role

Define a type role group. This group categorizes text styles based on their function, such as:

  • Display (for large, attention-grabbing text)
  • Heading (for section titles)
  • Subheading (for secondary headings)
  • Body (for main content text)
  • Caption & Label (for small text elements like footnotes and form labels)
Organizing semantic typography tokens by their type role.

4. Establish type scales within each type role

Inside each type role, create a sub-group for different type scales, such as:

  • XL (Extra Large)
  • L (Large)
  • M (Medium)
  • S (Small)
Establishing type scales within different type roles in a design system.

These sub-groups set up a clear type scale hierarchy, providing a flexible and consistent framework for typography usage within your design system.

5. Set up variables for typographic properties

For each type scale (XL, L, M, S), define the following key typographic variables using your primitive tokens:

  • Font Weight: Assign predefined values such as Regular, Medium, Bold.
  • Font Size: Set scalable font sizes appropriate for each type role.
  • Line Height: Define line heights optimized for readability based on font size.
  • Letter Tracking (Spacing): Adjust spacing for improved legibility based on type scale and case.
Setting up typographic variables for a semantic tokens

By referencing primitive tokens, these variables ensure consistency and flexibility while maintaining design system integrity.

After setting up your semantic typography tokens in Figma and defining the core typographic variables, the next step is to bring these elements to life by applying them to your text styles.

This guide outlines how to apply semantic tokens to your typography styles, using “Heading XL” as an example. The process ensures that your text styles are both consistent and adaptable across various breakpoints (Web, Tablet, Mobile).

Semantic token definition for “Heading XL”

Begin by creating a type scale reference that outlines the various type scale you need , we would be using XL. (Note: The initial sizes and values can be arbitrary, as they will be updated later.)

Heading XL type scale for the web

Update the names of each text style to match the semantic token convention defined in Figma. For example, rename the style to “Heading/XL/BOLD.” This semantic naming links the text style to its function (e.g., headings, subheadings) , scale and font weight.

Renaming based on semantic tokens

Utilizing a plugin like “Styler” allows us to generate figma text styles based on our renamed elements.

Figma screenshot showing the “Styler” plugin being used to generate text styles from renamed typography layers

By selecting each style and running the plugin, we create the initial text styles for “Heading XL.”

An image showing the result of using a plugin to generate text styles.

Right now, the Heading XL style doesn’t have the correct font sizes, weight, tracking or line heights. To fix this, I rearranged the order to prioritize the Bold variant, then clicked on “Edit Style” to update the settings.

Figma screenshot showing the “Edit text style” modal for the “Bold” variant of “Heading XL,” where font properties like family, weight, size, and line height are being updated.

Currently, the values for font weight, size, line height, and letter spacing appear arbitrary. To standardize these, we’ll apply the predefined structure. First, update the font family to match the semantic type token. Click on the variable icon (the settings icon) to access the field where you can make this change.

Screenshot showing the font family dropdown menu in the “Edit text style” modal, with “Satoshi” selected to match the semantic type token.

Next, we update the font weight. An efficient method is to copy the text style name from the layers panel and paste it into the token search field. This approach eliminates the need to manually scan through tokens, streamlining the process.

Figma screenshot showing the search for “Heading/XL/Bold” and the “Edit text style” modal with the “Weight” set to “Bold.”

After selecting the Bold weight, you can apply the same process to adjust the font size, line height, and letter spacing by choosing their corresponding semantic tokens.

Figma screenshot showing the “Edit text style” modal for “Heading XL Bold,” with settings for font family (token), size, line height, and letter spacing.

Once the Bold variant has been updated, we apply the same process for the remaining font weights, medium and regular. Initially, we set arbitrary values, but after applying the semantic tokens, the values have been adjusted accurately. The updated styles now perfectly reflect our intended design.

A visual summary of the updated “Heading XL” typography style for the web.

Next, we need to adapt the typography style for our breakpoints , web, tablet, and mobile. To achieve this, we apply variable mode to the typography style. Since we’ve already established breakpoints using semantic tokens and created distinct modes for each, this approach allows for seamless switching and consistent typography across all devices.

Figma screenshot of the breakpoint selection dropdown (Desktop, Tablet, Mobile) for the “Heading XL” text style, showing variable mode.

With the new settings in place, you can now switch between desktop, tablet, and mobile modes. Next, duplicate the typography scale twice — one copy for Tablet and one for Mobile — and apply the variable mode for each. The image below illustrates this process.

“Heading XL” typography style adapted for web, tablet, and mobile, showing the varying properties for each breakpoint.

Now, for Heading XL, I can easily switch between Web, Tablet, and Mobile modes. The benefit of this approach is that it consolidates the Heading XL style into a single category within the text styles, rather than creating separate categories for each breakpoint. This streamlined method makes toggling between breakpoints quick and efficient.

Text styles panel showing “Heading/XL” as a single category with Bold, Medium, and Regular weight variations.

Source link

Related