Case study · Design systems

One system, many brands.

01  The problem

The problem

At Global Personals, our main Figma library carried our 5 highest-traffic white-label sites, out of a much larger network. Each one had its own name, logo, and colors. Every new component had to look right on all of them. Checking every brand by hand after each change wasn't realistic.

So I built each Figma component once and let the tokens handle the brand.

02  Brand flip

Switch brands. The markup stays the same.

These five brands are made up. The last one is a stress test, with a very long name and colors that fail contrast on purpose. Turn off the fallback to see what it looks like without the fix.

Brand
Workshop

Home brewing basics

Saturday · 10 AM · 8 seats left

Jump to sign-up

Save your seat

We'll send one reminder.

Contrast · every pair passes

PairFigma valueShown
Primary button textneeds 4.5:19.6:1same
Navbar textneeds 4.5:19.6:1same
Card label on accentneeds 4.5:19.0:1same
Link on whiteneeds 4.5:15.2:1same
Link hover on whiteneeds 4.5:19.6:1same
Focus ring on pageneeds 3:14.7:1same

03  How the variables work

Brand lives in one collection. Everything else stays put.

The Figma library has a Color collection with one mode per brand. Spacing and type don't change between brands, so they have one mode each. Flip a frame's mode and every component inside it takes on the new brand.

The Color collection in Figma: 38 variables in groups like Base, Primary, Secondary, and Link, with a column of values for each of five brands.
The Color collection in the Figma library. One column per brand.

Same names in Figma and code

Code uses the Figma names, so a designer and a developer can search for the same word. It converts them mechanically: lowercase, and slashes and spaces become hyphens.

Figma variableCSS variableTailwind class
Primary-color--primary-colorbg-primary-color
Secondary-text-color--secondary-text-colortext-secondary-text-color
Accent-color--accent-colorbg-accent-color
Button-secondary-bg--button-secondary-bgborder-button-secondary-bg
Inputs-bg-inactive-3--inputs-bg-inactive-3border-inputs-bg-inactive-3

04  Figma to code

One button, three views.

The Figma component, the live component, and the code. Each Figma binding becomes one class.

Figma · Button

Variants
Type, Size, State, and Style. 200 in all.
Fill
Primary-color
Stroke
Secondary-color
Text
Secondary-text-color
Type
text-base/semibold
Padding
10 × 18, from spacing/2_5 and spacing/4_5
Effect
Shadow/xs

Live · every brand

Code · HTMX and Tailwind

<!-- button.html: written for this page, not copied from the production library -->
<button
  class="inline-flex min-h-11 items-center gap-2 rounded-pill border
         px-4.25 py-2.25 text-base font-semibold shadow-xs
         bg-primary-color
         border-secondary-color
         text-secondary-text-color
         hover:border-secondary-hover-color"
  hx-post="/reservations"
  hx-target="#status">
  Reserve a seat
</button>

05  AI workflow

Give the AI a job, and a list of what not to try.

I used Cursor, Claude, and the Figma MCP to build the components in an HTMX library with Tailwind. The classes use the same variable names as Figma.

The AI did well once a markdown file defined its job. It struggled with bug fixing. So I kept a painpoints.md file. Anything that took more than a few tries went in it. Once the AI knew what not to try, it got better.

This case study was built the same way. The excerpts below come from this project's own files. They aren't the original files from Global Personals.

rules.md · excerpt
## Source of truth

- Variable names come from the Figma library (MAIN LIBRARY, listed under Files). Change it only when Derol approves.
- Code uses the variable name only, without its group. In Figma, `Secondary-text-color` sits in the Secondary group. In code it's `--secondary-text-color`.
- Every variable name must be unique across the collection, so dropping the group can't cause a clash.
- The name is converted mechanically, nothing more:
  - lowercase
  - spaces become `-`
  - repeated `-` collapse to one
- Tailwind classes use the same name with the utility for the property it sets: `bg-primary-color`, `text-secondary-text-color`, `border-secondary-color`.
- Spacing follows Figma's `spacing/N` scale, where N × 4px is the value. `spacing/1_5` is Tailwind `1.5`.
- Text sizes follow Figma's `text-{size}/{weight}` styles, which match Tailwind's names and sizes.
- Brand values live in `src/data/brands.ts`. Nothing else holds a color.
painpoints.md
# painpoints.md

Bugs in this project that cost at least one failed attempt and could happen again. Read this before debugging. Each entry lists the symptom, what failed, what worked, and the rule to follow next time.

## Contrast rows vanished from the table

- Symptom: rows the fallback had fixed disappeared from the contrast table.
- What failed: marking them with a plain `fixed` class. Tailwind scans `src/components/ds/` and read it as its `position: fixed` utility.
- What worked: renaming the class to `is-fixed`.
- Rule: don't use a plain class name that is also a Tailwind utility. Prefix it.

06  The result

One component, every brand.

A component built once in Figma could be checked on any brand by switching a mode. The code used the same names, so it switched the same way.

Shipped reward modal, shown in 5 of our highest-traffic white-label color sets. Only the variables change.

←  Back to the portfolio