November 28, 2023

The Grouping Structure I Used to Organise Variables in Figma

After creating a colour palette I was happy with, it was time to start defining colour variables using the not-so-recently released Variables feature in Figma. I needed to figure out a hierarchy to organise all of them. I jumped right in and figured out as I went along.

Oh and yes, I had to upgrade my Figma account to be able to play around with Variables without limitations.

To summarise, this is the hight-level structure I have so far – multiple collections for different purposes, and nested groups for better organisations. Variables in each collection can reference values defined in another collection.

Primitive Colours Collection:

This collection contains the base name: value pair for all possible colours. Eg. blue-50, blue-100 … blue-900. The variables from this collection are not intended to be used in the designs directly. Hence, I hid this collection from publishing to prevent showing this in other files. Underscore prefix in the collection name. Eg. “_primitive colours” did the job for me.

  • Brand
  • White (variations of white with opacities like white-100, white-90… white-10)
  • Grey (grey-50, grey-100… grey-900)
  • Accents (teal-50, teal-100… teal-900, blue-50, blue-100… blue-900 etc.)

Semantic Colours Collection:

This collection is intended to provide a layer of meaning to the variables in the Primitive collection. Semantic collection is divided into 4 groups based on usage. All relevant colour variables fall into one of these groups...

  • Text
  • Background
  • Icon
  • Separators (borders, dots, dividers)

For reference, Uber’s Base Design System uses 3 groups instead of 4 namely content (text, icons, illustrations), background (all surfaces) and borders (all lines).

Each group further contains nested groups to organise variables…

  • Text (neutral, brand, accent)
  • Background (neutral, brand, accent)
  • Icon
  • Separator (neutral, white)

Component Colours Collection (WIP):

This is a work-in-progress. The idea is to repurpose variables from Semantic collection to be more meaningful by defining the components they should be used with. Eg. buttonMain, buttonHover, buttonDisabled etc.

For my website, there aren’t that many components needed. So this collection becomes less practical, and more of a good practice kind of thing.