<?xml version="1.0" encoding="utf-8"?>

Are variables the first thing designers need to learn when they start designing in Figma? Of course not. However, if you're a designer who values consistency and streamlined collaboration within a team, at some point, learning about variables becomes important. You might also join a larger team that already utilizes variables in its design system.

Understanding and utilizing Figma variables can empower you as a designer to streamline your workflow, maintain design consistency, enhance collaboration, and create adaptable and interactive designs. It can elevate the efficiency, scalability, and overall quality of design projects, making it an essential skill for designers to unlock the full potential of Figma as a powerful design tool.

Exercise #1

What are Figma variables?

What are Figma variables?

In Figma, variables are reusable design properties, colors, text, numbers, or boolean values that you can use across your files or prototypes. They offer a powerful way to maintain design consistency and efficiency. By assigning properties to variables, designers can easily make global changes across their design system.

For example, if you have multiple buttons in your design, you can create a "Button Color" variable and assign it to all the buttons. When you update the color value of this variable, all the buttons linked to it will automatically get updated, ensuring a consistent color scheme throughout your design.

Furthermore, Figma variables can be used to create interactive design elements. By leveraging boolean variables, you can define different states for components, such as hover or active states. This allows for more realistic and interactive prototypes within Figma.[1]

Exercise #2

The benefits of variables

The benefits of variables Bad Practice
The benefits of variables Best Practice

In Figma design, variables bring some awesome advantages:

  • Design tokens: Variables let you define and store design elements, known as design tokens, keeping things consistent across your designs and prototypes.
  • Easy updates: Variables make it a breeze to update values throughout your design system. Changes automatically apply to all instances of the element, saving you time and effort.
  • Flexible design switching: With variables, you can seamlessly switch between different design styles or contexts. Just update the variable values, and your designs stay consistent.
  • Smooth prototyping: Variables take your prototyping to the next level. You can create high-fidelity prototypes using fewer frames. Updating variable values applies changes throughout the entire prototype.
Exercise #3

Styles vs. variables

Styles vs. variables Bad Practice
Styles vs. variables Best Practice

Variables are like containers that store and reuse design elements such as colors, text strings, and numbers. They help you manage these elements throughout your design. Styles, on the other hand, are a way to apply a set of properties to an element. For example, you can create a style called "Heading 1" that defines the font size, letter spacing, weight, and other parameters of headings in your design. Applying this style to headings ensures consistency across your design, and any changes made to the style will affect all instances of it.

Now, here's where variables and styles work together. You can use variables within styles to store property values. For instance, you can create a style called "Primary Button" that uses a color variable for the background color and text variables for font properties. This way, you can easily maintain consistency and update design elements throughout your project.

By using variables and styles together, you can create a more efficient design system. Variables store and reuse design elements, while styles provide a way to apply properties to elements consistently. This combination helps you keep things organized, make updates easily, and ensure a cohesive design.

Exercise #4

Color variables

Color variables

Color variables in Figma allow you to store and reuse color values throughout your designs, ensuring consistency and efficiency. They provide a centralized way to manage your color palette. Instead of manually specifying color values for each design element, you can assign a color variable to them. For example, you can create a "Primary Color" variable and apply it to buttons, text, or any other element where the primary color is used.

The real power of color variables lies in their flexibility. If you decide to change the primary color of your design, you can simply update the value of the color variable. Figma will automatically propagate the changes to all elements connected to that variable, maintaining consistency across your entire design system.

Color variables also allow you to experiment with different color schemes. By modifying the value of a color variable, you can instantly see how the changes affect your design elements. This flexibility enables you to iterate and explore various color options with ease.[2]

Exercise #5

Text variables

Text variables Bad Practice
Text variables Best Practice

Text variables in Figma contribute to maintaining consistency and efficiency across your design system. You can create a text variable by selecting a text string you want to reuse, such as a common button label or a specific heading style. Next, assign this text string to a new text variable with a descriptive name that reflects its purpose, like "Button Label" or "Heading Style."

Once you have your text variable, you can apply it throughout your design instead of manually entering the same text repeatedly. For instance, if you have multiple buttons with the same label, applying the text variable to each button saves you from individually typing the label. By utilizing the text variable, any updates made to its value will automatically propagate across all instances linked to that variable, ensuring consistency effortlessly.

Text variables offer flexibility when modifications are needed. If you decide to change a text string across your design system, modifying the value of the text variable accomplishes this in a single place. Consequently, all elements connected to the variable will reflect the updated text, saving you time and effort.

Exercise #6

Number variables

Number variables Bad Practice
Number variables Best Practice

Number variables in Figma are invaluable for storing and reusing numerical values in designs, particularly when establishing a consistent spacing system. You can create a number variable by selecting a numerical value like a specific spacing measurement or a standard grid size. Assign this value to a new number variable with a descriptive name, such as "Spacing Small" or "Grid Size."

Once you have a number variable, it becomes effortless to apply it throughout your design instead of repeatedly entering numerical values. For instance, if you have multiple elements requiring consistent spacing, use the number variable to define the desired spacing value. Any updates made to the number variable will automatically adjust the spacing of connected elements.

Exercise #7

Boolean variables

Boolean variables Bad Practice
Boolean variables Best Practice

Boolean variables in Figma enable the creation of conditional logic, where elements can be shown or hidden based on user input or other conditions.

Create a boolean variable by following the steps:

  • Select a true/false value that you want to reuse, such as a toggle switch state or a checkbox selection
  • Create a new boolean variable and assign the chosen true/false value to it
  • Give the variable a descriptive name that reflects its purpose, like "Toggle State" or "Checkbox Selected"

Once you have your boolean variable, you can use it throughout your design to control the visibility or behavior of elements. For instance, if you have a dropdown menu that should only be visible when a toggle switch is in the "on" position, you can apply the boolean variable to control the visibility of the dropdown menu. By utilizing the boolean variable, changes to its value will automatically show or hide the dropdown menu, ensuring dynamic interactions within your design.

Pro Tip: Use boolean variables for interactive prototypes with conditional logic, making elements show or hide based on user input and conditions.

Exercise #8

Naming conventions for variables

Naming conventions for variables Bad Practice
Naming conventions for variables Best Practice

When it comes to naming variables in Figma, using descriptive names is key. The goal is to choose names that clearly convey the purpose of each variable, making it easy for both you and your teammates to understand and locate them.

Imagine you have a color variable that represents the primary color in your design system. Naming it "primary-color" or something similar instantly communicates its purpose. This descriptive name eliminates any confusion and helps you quickly identify and utilize the variable throughout your design. It ensures consistency and clarity in your design system.

Another valuable practice is to group variables together based on their functionality. For instance, you can create collections or groups to organize your color variables, typography styles, or any other relevant categories. By doing so, you establish logical groupings that simplify the management and navigation of variables.

When you're working with a large design system, this organization becomes even more crucial. It enables you to locate specific variables without hassle and fosters a more efficient workflow.

Exercise #9

Changes to variables

Changes to variables

Modifying variables in Figma is a straightforward and efficient process that allows you to update values and instantly see the changes applied throughout your design.

To modify a variable, start by selecting it in your design. You can do this by clicking on an element that uses the variable or locating it in the Design panel. Once the variable is selected, you can easily change its value to update the corresponding design element.

For instance, let's consider a string variable named "main navigation menu" that is used across multiple screens. If you want to change one of the labels from "Who are we?" to "Meet the team," simply select the variable and make the update.

The new label will instantly propagate to all instances where the variable is used. This efficient process saves time and effort, eliminating the need to manually update each individual element.

With variable modifications, you have the flexibility to experiment, iterate, and refine your design without the hassle of manual updates.

Exercise #10

Groups and collections of variables

Groups and collections of variables Bad Practice
Groups and collections of variables Best Practice

In Figma, both groups and collections serve as organizational tools for variables, with slight differences in their usage.

Let's consider a design system with various colors. Creating a color collection allows you to keep all color variables in one organized place. For example, you can have variables for primary, secondary, and accent colors within this collection. This ensures consistency and easy access when applying colors throughout your design.

Additionally, you can create a color group called "Primary Colors" to group variables like "Primary Red," "Primary Blue," and "Primary Yellow."

Similarly, you can create a text group to manage text variables across your design system. This group can include variables for headings, paragraphs, and captions, allowing you to easily apply consistent typography styles.

By utilizing color collections and groups, as well as text groups, you can maintain an organized design system, ensuring consistency and efficiency in your designs.

References

Top contributors

Igor Lončar

Topics

Share

Complete this lesson and move one step closer to your course certificate