Skip to content
turn

guides

Theming

The color tokens the components read, and how to change them.

you probably do not need a theme

The components use the standard shadcn color tokens, so they pick up the theme your project already has. If you set up your project with shadcn init, skip the theme and the components will look like the rest of your app.

the optional turn theme

If you want turn's own look (black and warm off-white, with a light companion), install the theme item. It writes the tokens below into your global stylesheet for both light and dark.

bash
npx shadcn@latest add https://turnui.xyz/r/theme.json

It replaces your existing values for these token names, which restyles your whole app, including any shadcn components you already use. Install it on a new project, or when you want that palette everywhere. To change only the components, edit the tokens yourself instead.

tokens

The components use only these eight, all of which a standard shadcn theme already defines, through ordinary Tailwind utilities such as bg-muted and text-muted-foreground.

tokenused fordarklight
backgroundPage, composer and popup surfaces.#000000#ffffff
foregroundPrimary text, active borders, the default button.#efefe4#0a0a0a
mutedQuiet fills: user bubbles, code chips, hover rows.#1a1a1a#f2f2ee
muted-foregroundSecondary text, labels, placeholders.#a3a3a3#525252
borderEvery hairline. Components use the plain border utility.rgb(255 255 255 / 0.13)rgb(0 0 0 / 0.12)
primaryPrimary action: the send button, progress, the selected item.#efefe4#0a0a0a
primary-foregroundText on top of primary.#0a0a0a#fafaf5
ringFocus rings.#efefe4#0a0a0a

what the tokens map to

If you set things up by hand, this is everything the components need. The theme item writes the variables; shadcn init adds the rest. The @custom-variant line matters: a few components use dark: variants, for example the code colors and the status text.

css
:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --muted: #f2f2ee;
  --muted-foreground: #525252;
  --border: rgb(0 0 0 / 0.12);
  --primary: #0a0a0a;
  --primary-foreground: #fafaf5;
  --ring: #0a0a0a;
}

.dark {
  --background: #000000;
  --foreground: #efefe4;
  --muted: #1a1a1a;
  --muted-foreground: #a3a3a3;
  --border: rgb(255 255 255 / 0.13);
  --primary: #efefe4;
  --primary-foreground: #0a0a0a;
  --ring: #efefe4;
}

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-border: var(--border);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-ring: var(--ring);
}

@layer base {
  * { border-color: var(--border); }
}

shape, color and type

  • Corners are fixed at 4px for panels and 2px for inner items, in the markup of each component. They do not follow --radius, so a rounded theme will not change them. Search for rounded in a component to change its corners.
  • Status colors (success, warning, error) use Tailwind's emerald, amber and red directly, with darker shades on light backgrounds so text stays readable. They are not tokens. Edit them in the component if you want your own.
  • Code, durations and labels use font-mono. Define it in your theme if you want a specific monospace font.