← Multi brand v2

Multi brand: chart colors per brand

In a multi brand file, every brand can have its own chart colors: five like shadcn/ui, or more if its dashboards need them. This tutorial gives two brands, shadcn and acme, their own seven chart colors, and exports them with the CSS Export plugin.

Two brands side by side in Figma: shadcn with blue, orange, green, red, sky, pink and yellow chart colors, and acme with violet, amber, teal, rose, lime, indigo and stone. The same bar chart and donut chart from the kit use each brand's colors.

What you need: a multi brand kit file with at least two brands (see Multi brand v2, step 1), and version 3.1.0 or later of the CSS Export plugin. Give each brand a mode with the same name in every collection: then one click in the plugin selects the whole brand.

Where chart colors live#

The chart colors are a group called chart colors inside the theme collection: chart 1 to chart 5. In a multi brand file, theme has a mode per brand, so every brand already has its own column of chart colors. A new brand starts as a copy of an existing one, so it shows the same chart colors until you change them.

Step 1: set each brand’s chart colors#

  1. Open Local variables and select the theme collection.
  2. Open the chart colors group.
  3. In the shadcn column, set chart 1 to chart 5. Alias a color from raw tailwind colors, or type a value.
  4. Do the same in the acme column.

This is the setup in the image above:

Variableshadcnacme
chart 1blue 600violet 600
chart 2orange 500amber 500
chart 3emerald 600teal 600
chart 4red 600rose 500
chart 5sky 400lime 500
chart 6pink 500indigo 400
chart 7yellow 400stone 500

Use clearly different hues when each color stands for a category, like a channel or a product. Shades of one color look calm in a screenshot, but they’re hard to tell apart in a real chart.

Step 2: add more chart colors#

  1. In the chart colors group, add a color variable named chart 6, and another named chart 7. Keep them inside the group: the full names are chart colors/chart 6 and chart colors/chart 7.
  2. Give them a value in every brand’s column. A variable exists in every mode, so each brand gets a chart 6 and chart 7, even if its charts only use five today.

Number them on from 5 (chart 6, chart 7, …). The plugin exports them in that order.

Step 3: check them on the canvas#

Select a frame with charts, and in the Appearance panel set theme to shadcn, then to acme. The kit’s charts switch to that brand’s colors.

Set shadcn colors to the brand too. If a new brand’s light mode looks dark, the mode was created as a copy of shadcn-dark. Copy the values of shadcn into it, and those of shadcn-dark into the brand’s -dark mode.

Step 4: export each brand#

  1. Open the CSS Export plugin.
  2. In Setup, pick acme in the Brand picker at the top. It sets every collection to acme at once, because the brand’s modes have the same name everywhere.
  3. Check the preview: it shows a swatch for every chart color.
  4. Copy or download the CSS.
  5. Repeat with shadcn picked as the brand.

The chart colors come from the brand picked for theme: the note under that row says so. If you change a collection on its own, Setup warns when theme and shadcn colors end up on different brands, because the export would then mix two brands. It also warns when a brand exists in one of the two collections but not the other.

The acme export contains seven chart colors:

:root {
  --chart-1: oklch(…);
  …
  --chart-7: oklch(…);
}

@theme inline {
  --color-chart-1: var(--chart-1);
  …
  --color-chart-7: var(--chart-7);
}

The shadcn export has the same variable names with its own values. That’s what makes switching brands work in code: the components use the same names, and the stylesheet decides the colors.

A brand’s chart colors apply in light and dark mode: they’re in :root, and the .dark block doesn’t override them.

Using them in code#

shadcn/ui charts read their colors from a chart config. Point each series at a chart variable:

const chartConfig = {
  search: { label: "Search", color: "var(--chart-1)" },
  direct: { label: "Direct", color: "var(--chart-2)" },
  // …
  events: { label: "Events", color: "var(--chart-7)" },
} satisfies ChartConfig

Tailwind classes work too: bg-chart-6, fill-chart-7, stroke-chart-1.

How a developer loads one stylesheet per brand is in the designer tutorial.