Skip to content

Color

Every colour token by role, with its CSS variable, Tailwind class and light and dark value. Pick an accent to retint this page, then copy the CSS.

On this page

How the tokens are layered

Knowns UI adds no colour system of its own on top of your theme. Components read the shadcn-style tokens you already have, and only reach past them for status colours and chart series. Four layers, from the ones you own to the ones we default.

LayerWhat it holdsWho sets it
1. Theme tokensText, surfaces, borders and focus: --background, --foreground, --card, --muted, --border, --ring and --primary. Light on :root, dark on .dark.Your theme. The site uses the shadcn neutral set.
2. Accent hook--kn-accent and --kn-accent-foreground. Buttons, progress, switches and the accent tone read them and fall back to --primary.Unset. Set it on any element to recolour that region.
3. Status tonesInfo, success, warning and danger, taken from the Tailwind palette (sky, emerald, amber, red) with a lighter shade in dark mode.The components. Not theme variables, so they stay legible on any background.
4. Chart series--chart-1 to --chart-5, with a built-in default for each. One accent, quiet neutrals and two meaning colours.Optional. Set them to restyle every chart.

Try an accent

An accent re-points only --primary, --primary-foreground and --ring, so every block on this site recolours at once, light and dark. The choice is the same control as the one at the bottom of the page. Copy the CSS for the scope you want and paste it after your knowns.css import.

Accent
Copy for
Neutral
AccentSolid
Build
64%
theme.cssCSS
/* Neutral is the default: there is nothing to override. */

Text and foreground

Colour of text and icons. Quiet fills and hairlines in the blocks are mixed from --foreground, so they follow it.

4 rows
SwatchCSS variableTailwind classLightDark
oklch(0.145 0 0)oklch(0.985 0 0)
oklch(0.52 0 0)oklch(0.708 0 0)
oklch(0.145 0 0)oklch(0.985 0 0)
oklch(0.145 0 0)oklch(0.985 0 0)

Background and surface

The page and the layers on it: cards, popovers and quiet fills.

4 rows
SwatchCSS variableTailwind classLightDark
oklch(1 0 0)oklch(0.145 0 0)
oklch(1 0 0)oklch(0.185 0 0)
oklch(1 0 0)oklch(0.205 0 0)
oklch(0.97 0 0)oklch(0.269 0 0)

Border and focus

Hairlines, field outlines and the focus ring.

3 rows
SwatchCSS variableTailwind classLightDark
oklch(0.922 0 0)oklch(1 0 0 / 10%)
oklch(0.922 0 0)oklch(1 0 0 / 15%)
oklch(0.708 0 0)oklch(0.556 0 0)

Accent

The one highlight colour. Components read --kn-accent and fall back to --primary.

4 rows
SwatchCSS variableTailwind classLightDark
oklch(0.205 0 0)oklch(0.922 0 0)
oklch(0.985 0 0)oklch(0.205 0 0)
var(--primary)var(--primary)
var(--primary-foreground)var(--primary-foreground)

Status

Meaning colours for info, success, warning and danger. They come from the Tailwind palette, not from theme variables.

8 rows
SwatchCSS variableTailwind classLightDark
oklch(50% 0.134 242.749)oklch(82.8% 0.111 230.318)
oklch(68.5% 0.169 237.323)oklch(68.5% 0.169 237.323)
oklch(50.8% 0.118 165.612)oklch(84.5% 0.143 164.978)
oklch(69.6% 0.17 162.48)oklch(69.6% 0.17 162.48)
oklch(47.3% 0.137 46.201)oklch(87.9% 0.169 91.605)
oklch(76.9% 0.188 70.08)oklch(76.9% 0.188 70.08)
oklch(50.5% 0.213 27.518)oklch(80.8% 0.114 19.571)
oklch(63.7% 0.237 25.331)oklch(63.7% 0.237 25.331)

Chart

Series colours in order. Unset, the chart uses the defaults shown; set --chart-1 to --chart-5 to restyle every chart.

5 rows
SwatchCSS variableTailwind classLightDark
oklch(0.585 0.2 277)oklch(0.585 0.2 277)
oklch(0.62 0 0)oklch(0.62 0 0)
oklch(0.66 0.14 160)oklch(0.66 0.14 160)
oklch(0.74 0.15 75)oklch(0.74 0.15 75)
oklch(0.62 0.19 20)oklch(0.62 0.19 20)

Theming covers dark mode and installing the tokens. Variants & colours shows recolouring a single region. Typography documents the type scale.

Need help?

Stuck on Color, or found something off? We read every message.