Guide and Best Practice on Using Variables for Design System in Figma

Gavin Chiemsombat
6 min readJul 10, 2023

--

Design systems are the backbone of modern UI/UX design, ensuring consistency and efficiency. Figma now offers a powerful feature called variables that can take your design system to the next level. This time, we’ll explore how to use variables in Figma, step by step, and share best practices to optimize your design system workflow.

An image of how variable works; linking libraries of color style with variable windows that can be access during prototyping phase
https://help.figma.com/hc/en-us/articles/14506821864087

Using Variables in Figma

Variables promote consistency by enabling designers to define and update values in one place, ensuring that all related design elements reflect the changes. For example, if you have a primary color variable, you can easily update it to reflect a new brand color throughout your entire design system, instantly maintaining consistency.

Secondly, variables enhance scalability and flexibility. With variables, you can create reusable design components that adapt to different screen sizes and contexts. For instance, if you have a button component with a font size variable, you can easily adjust the font size for different button instances without having to manually update each one individually. This saves time and effort, especially when working on complex projects with multiple design elements. (Say goodbye to those 15 redundant prototype screens that do basically the same thing over and over with here-and-there minor changes across the board)

Applying variables to design elements in Figma is simple and intuitive. Let’s say you have a color variable for your primary button color. You can select a button element, access the Properties panel, choose the color variable from the Variables section, and apply it to the button. Any changes made to the color variable will automatically update the button’s color throughout your design system.

Animated image of figma workspace where Variable has been used to switch the color of the component from dark to light theme with a few clicks
Variable modes example — https://help.figma.com/hc/en-us/articles/14506821864087

Updating variables is equally effortless. Let’s say you decide to change the font size of your heading text. By updating the font size variable, all instances of heading text using that variable will automatically adjust accordingly, maintaining consistency across your design system.

Best Practices for Using Variables in Figma

To make the most out of variables in Figma and establish a streamlined design system workflow, consider the following best practices:

Naming Conventions and Guidelines for Variables

Use clear and descriptive names for your variables. For example, instead of using “Color1” or “TextStyle2” opt for names like “Primary.Color” or “Heading-1” to provide better context. This makes it easier for designers to understand and use variables correctly, even when collaborating with multiple team members.

Examples of Effective Naming Conventions

Let’s explore a few examples of how an effective naming convention can be applied to different types of variables within a design system:

Color:

Choosing Intuitive Names for Color Palettes like;

clr_primary: #4285F4
clr_secondary: #34A853
clr_background: #F1F3F4

Using clear and intuitive names for color variables makes it easier for designers and developers to identify and use specific colors throughout the design system.

Typography:

Utilizing Font Family and Weight Indicators

typ_heading_primary: "Roboto", sans-serif; weight: 700
typ_body_regular: "Open Sans", sans-serif; weight: 400
typ_link: underline; weight: 400

In typography variables, including font family and weight indicators provides clarity and consistency in text styles across the design system.

Spacing:

Incorporating Size and Location Details

spacing_small: 8px
spacing_medium: 16px
spacing_large: 24px

For spacing variables, incorporating size details helps designers and developers maintain consistent spacing throughout the design system.

Establishing a Systematic Approach to Variable Usage

  • After coming up with a naming convention, create a well-documented guideline or style guide for using variables within your design system.
  • Define rules for when and how to use variables, ensuring that all team members follow the same conventions. For example, establish guidelines for when to use color variables versus effect variables or spacing variables.
  • This systematic approach minimizes confusion and ensures consistent design application throughout the system.

Documenting and Communicating Variables within a Team

  • Document your variables and their usage to facilitate collaboration.
  • Create a central repository or documentation that outlines all the variables in your design system, their purpose, and usage guidelines.
  • Include examples and visual references to help team members understand how to utilize variables effectively. This documentation acts as a reference point for designers and developers, promoting clarity and reducing ambiguity.

Advanced Techniques with Variables in Figma

While variables provide a powerful foundation for maintaining consistency, Figma offers advanced techniques that further enhance their functionality. Let’s explore a couple of these techniques:

Using Nested Variables for Complex Designs:

Nested variables allow you to create more complex and interconnected design systems. For example, consider a card component that consists of a background color, text color, and border radius. By using nested variables, you can define variables for each of these properties and then combine them into a single nested variable for the card component. This simplifies the customization and management of complex design elements, making creating consistent and adaptable designs easier.

Image depicting the variable management windows of Figma. Outlining the structure of how to arrange different variables via groups and modes
Example of grouping by type/variables/modes — https://help.figma.com/hc/en-us/articles/15145852043927/

Creating Conditional Variables for Dynamic Design Variations:

Conditional variables enable you to create design variations based on specific conditions or contexts. For instance, imagine you’re designing a mobile app that needs different button styles for light and dark themes. By using conditional variables, you can define variables for each theme and set up rules to apply the appropriate variables based on the selected theme. This allows you to maintain a single design system while accommodating different variations based on conditions or user preferences.

Additionally, Figma is known for a wide range of plugins and integrations that extend the functionality of the primary function of the platform (and to think we got variables nowadays because of a token plugin after all!). Wait and see if the community comes up with an amazing plugin ecosystem and tools that align with your specific design system requirements and further enhance your variable usage.

Common Challenges and Troubleshooting

Using variables in Figma may present some challenges. Here are a few common issues and strategies to overcome them:

  • Learning Curve: Variables may require a learning curve for designers who are new to the concept. Encourage team members to explore tutorials, documentation, and online resources to gain a better understanding of how to utilize variables effectively.
  • Resistance to Change: Some team members may be resistant to adapting to a variable-based workflow, especially if they’re used to traditional design methods. To overcome this resistance, do a show and tell session, let ppl see the advantages of using variables, such as improved consistency, time savings, and scalability. Show examples of how variables can streamline the design process and make updates easier. This will more than likely to convince them to start asking around for adopting this!

To troubleshoot common issues, consider the following strategies:

  • Unintended Side Effects: When updating a variable, unintended side effects may occur, such as unexpected changes in other design elements. Double-check design elements that use the variable to ensure they reflect the desired changes. Review and test the impacted areas of your design system to ensure that it won’t break things.
  • Inconsistent Usage: Inconsistent usage of variables may lead to inconsistencies in the design system. Regularly review and audit your design system to identify and correct any deviations from established guidelines. Provide feedback and guidance to team members to ensure they understand and follow the defined variable conventions.

By being proactive and addressing these challenges, you can ensure a smooth variable-driven design system workflow in Figma.

Get out there and start ena-rible-ling!

Variables in Figma empower you to create dynamic, consistent, and adaptable design systems. By following best practices, exploring advanced techniques, and troubleshooting common challenges, you can optimize your design system workflow and achieve a cohesive and efficient design process. Embrace the possibilities that variables offer and collaborate with your team to leverage the full potential of variables in Figma.

For more about variables and best practices. Check out the official and really easy-to-understand Figma official guide here

--

--

Gavin Chiemsombat
Gavin Chiemsombat

Written by Gavin Chiemsombat

Product Designer based in Thailand. Occasionally shows up just to geek about Figma. Contact me — gggggggg@duck.com