Building a design system with Tailwind CSS: A step-by-step guide

Learn how to create a design system in Figma with step-by-step practice, covering creating Figma styles and variables for consistent and efficient design workflows.

Arlene Xu
UX Planet

--

Whether you’re a designer working for a company or pursuing your projects, building a design system is a crucial skill for an efficient workflow. Learning by doing is highly recommended. In this article, I will demonstrate using Tailwind CSS to create a Tailwind CSS UI Kit in Figma. By following these steps, you can gain inspiration and insights for building your design system.

Confirm the basic kit

In most cases, there are several fixed elements that need to be styled or defined as variables. Figma’s new feature released this year (2023 Config) allows us to accomplish this effectively.

Guide to variables in Figma

The basic kit typically includes:

  • Colors
  • Typography
  • Spacing
  • Border radius
  • Shadow
  • Breakpoints (Screens)

Colors

Tailwind CSS provides predefined color definitions. You can use these color codes directly or define your own colors within your design.

Get the color number from Tailwind CSS.

Get the color number from Tailwind CSS

Click the “Style” icon and then the “+” button.

Click on the “Style” icon and then click the “+” button.

Input the color name (e.g., “Slate/50”).

Input the color name (e.g., “Slate/50”).

Note: use a slash (”/ “) to categorize your colors.

Use a slash (”/ “) to categorize your colors

Repeat the above steps for each color style.

Example:

Screenshot of my figma file of color styles
Image from my Tailwind CSS UI Kit for Figma

Fonts

To define font sizes and font weights, refer to the values provided by Tailwind CSS.

Get the font sizes and font weights from Tailwind CSS.

Font sizes from Tailwind CSS.
Font weights from Tailwind CSS.

Click on the “Text Styles” icon in the right panel.

Click on the “Text Styles” icon in the right panel.

Create a new text style.

Create a new text style.

Done

Complete add a text style.

Repeat the above steps for each font size and weight combination style.

Example:

Typography styles.
Image from my Tailwind CSS UI Kit for Figma

Shadow

Tailwind CSS provides predefined shadow values. Use these values to define shadow styles in Figma.

Get the shadow value from Tailwind CSS.

Get the shadow value from Tailwind CSS.

Enter the shadow value in Figma.

Enter the shadow value in Figma.

Name the shadow for easy reference.

Repeat the above steps for each shadow style.

Repeat the above steps for each shadow style.
Image from my Tailwind CSS UI Kit for Figma

Spacing & Border Radius & Breakpoints (Screens)

Figma Config 2023 update introduced the ability to use numbers as reusable variables. Leveraging this feature enhances consistency between design and code, as numbers can be linked to margins, paddings, and radius values.

Guide to variables in Figma

Let’s use Spacing as an example

Get the spacing values from Tailwind CSS.

Get the spacing values from Tailwind CSS.

In Figma’s right panel, click on “Local Variables”.

In Figma’s right panel, find “Local Variables”.
In Figma’s right panel, click on “Local Variables”.

Rename the collection “Primitives” (or any other suitable name).

Rename the collection.
Rename the collection as “Primitives” (or any other suitable name).

Click the “Create variable” button and select ”Number”.

Click the “Create variable” button and select ”Number”.

Name the variable (e.g., “Spacing/1”) and assign it a value (e.g., 4px).

Name the variable (e.g., “Spacing/1”) and assign it a value (e.g., 4px).
Name the variable (e.g., “Spacing/1”) and assign it a value (e.g., 4px). Done.

Repeat the above steps for each spacing.

Repeat the above steps for each spacing.
Image from my Tailwind CSS UI Kit for Figma

Same way to create Border Radius and Breakpoints (Screens) variables.

Spacing variables.
Image from my Tailwind CSS UI Kit for Figma
Radius variables.
Image from my Tailwind CSS UI Kit for Figma
Screens variables.
Image from my Tailwind CSS UI Kit for Figma

Once established the basic styles and variables, you can use them to create a wide range of components.

Example:

Image from my Tailwind CSS UI Kit for Figma
Image from my Tailwind CSS UI Kit for Figma

Conclusion

By following the steps outlined in this article, you can effectively build your design system. Creating a design system is an ongoing process, and start by defining the basics and continue expanding your system to match the needs of your projects.

--

--