Sign up and get 15% off the four courses and Lifetime.

Figma, with AI

Lesson

Styles and variables, set once

Lesson 3 of 10 in Figma, with AI.

Checked against the makers' documentation on 4 November 2026.

Lesson

Styles and variables are how a Figma file stores a brand's decisions about colour, type and spacing, so each one is made once and every layer points back to it. A file that types the same green onto forty frames has made that decision forty times, and one of the forty will be slightly wrong.

They pay off when a client changes a colour late. With a colour variable, one edit moves every frame in the file and every file that uses the library. The example here is a juice bar chain whose posters, menu boards and posts share one green, with a second palette for the monsoon months.

Use a style for groups and a variable for single values

A style holds several values that apply together. A text style carries the font, size, weight, line height and letter spacing at once, and a colour style can carry a gradient with its angle. A variable holds one value, such as a colour, a number, a line of text, or true or false. Variables can sit inside styles, but styles cannot sit inside variables.

Figma says variables do not replace styles, and a studio file uses both.

Job in the juice bar fileUseWhy
Headline and body text settingsText styleSeveral values that always go together
The sunset gradient on the summer postersColour styleA gradient is more than one value
Brand green and the other brand coloursColour variableOne value that may change late
Spacing such as 8, 16 and 24Number variableOne value reused across every frame
Words that change between menusString variableOne line of text per version

Name each value for the job it does

Figma's own guidance recommends role names such as colour/surface/primary. A name like green-500 on a button tells a person very little. A name like action-primary says what the colour is for, and it still makes sense after a rebrand turns the green orange.

Use aliases to connect the two kinds of name. An alias is a variable that points at another variable. Make one variable called brand-green that holds the hex value, then point action-primary and price-tag-fill at it. Change brand-green and both follow. Figma's agent reads these names when it builds with your system, so clear role names help it too.

Add modes for seasons and themes

A collection is a group of variables that share the same modes, and a mode is another set of values for those variables. Give the juice bar's colour collection two modes, Summer and Monsoon. Switch a frame to Monsoon and everything inside it repaints in the monsoon colours, while the layout stays exactly as it was.

The number of modes depends on the plan. The free Starter plan keeps a single mode per collection, so check the plan before you promise a client a dark mode in the same file.

Prune before you publish

Figma's agent can pull the core colours from a screen into a scale, or turn every type size on a page into number variables. It copies what is there, mistakes included. If one price was set at 17 pixels by accident, that 17 becomes a variable unless you delete it.

So go through the list by hand. Delete near-duplicates, such as two greens one shade apart or a 17 beside a 16, and repoint any layer that used them. Publish the library only after that. On Organization and Enterprise plans, Check designs finds values typed onto layers by hand and suggests the variable to use instead.

The next lesson builds the brand's logo, price tag and other parts as components and variants.