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.
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#
- Open Local variables and select the
themecollection. - Open the
chart colorsgroup. - In the
shadcncolumn, setchart 1tochart 5. Alias a color fromraw tailwind colors, or type a value. - Do the same in the
acmecolumn.
This is the setup in the image above:
| Variable | shadcn | acme |
|---|---|---|
chart 1 | blue 600 | violet 600 |
chart 2 | orange 500 | amber 500 |
chart 3 | emerald 600 | teal 600 |
chart 4 | red 600 | rose 500 |
chart 5 | sky 400 | lime 500 |
chart 6 | pink 500 | indigo 400 |
chart 7 | yellow 400 | stone 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#
- In the
chart colorsgroup, add a color variable namedchart 6, and another namedchart 7. Keep them inside the group: the full names arechart colors/chart 6andchart colors/chart 7. - Give them a value in every brand’s column. A variable exists in every mode, so each brand gets a
chart 6andchart 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#
- Open the CSS Export plugin.
- In Setup, pick
acmein the Brand picker at the top. It sets every collection toacmeat once, because the brand’s modes have the same name everywhere. - Check the preview: it shows a swatch for every chart color.
- Copy or download the CSS.
- Repeat with
shadcnpicked 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.