Figma for Product Teams · 20 min · 140 XP

Variables, modes and themes

Collections, modes and aliases: how one file themes itself instead of being restyled by hand.

A variable is a named value you can reuse and re-point: color/bg/surface, space/200, radius/card. Change the variable and everything bound to it changes. That much is what colour styles already did. What variables add is modes.

Variables live in collections, and a collection can have several modes, such as Light and Dark, or Desktop and Mobile. Every variable in the collection holds one value per mode. You then set a mode on a frame, and everything inside it resolves through that mode. One set of screens, themed by a dropdown, with no duplicate pages to keep in sync.

Two collections: raw values, then meaning
Primitives (one mode)
  slate/900   #0B1220
  slate/50    #F8FAFC
  blue/500    #3B82F6

Semantic (modes: Light, Dark)
  bg/surface      Light → slate/50    Dark → slate/900
  text/primary    Light → slate/900   Dark → slate/50
  action/default  Light → blue/500    Dark → blue/500

Layers bind to the semantic names, never to slate/900 directly.

That two-layer arrangement is aliasing: a semantic variable points at a primitive rather than holding a hex value. It's worth the extra step because it gives you somewhere to say why a colour is what it is. bg/surface survives a rebrand; slate/50 sprinkled across two hundred layers does not.

Two more things to know. Variables come in four types (Color, Number, String and Boolean), so spacing, corner radius, and even a text string can be a variable, not just colour. And scoping limits where a variable is offered: scope space/200 to padding and gap and it stops appearing in the colour picker, which is how you keep the list usable at a few hundred variables.

Variables are not a replacement for styles. A type style bundles family, size, weight, line height and letter spacing into one named thing, and effect styles do the same for shadows. Use styles for those bundles and variables for single values that need to change by mode. Most mature files use both.

Do it in Figma: make a Primitives collection with three greys, a Semantic collection with Light and Dark modes aliasing them, and bind one screen's background and text to the semantic names. Switch the frame's mode. Anything that doesn't flip is bound to the wrong layer.

Loading your workspace…