shadcn/ui theme generator
Build a complete shadcn/ui theme in current oklch format from one brand color — light and dark modes, charts and sidebar tokens included.
Build a complete shadcn/ui theme from one brand color in the current oklch() convention. The generator emits matched light and dark variable blocks, including chart-1…chart-5 and sidebar tokens.
Paste the CSS into your global stylesheet and every shadcn component — buttons, cards, dialogs and charts — picks up the theme automatically.
Your brand hue drives --primary in both modes, but the two blocks are not copies: dark-mode primaries are lifted in lightness and softened in chroma so buttons stay vivid on dark surfaces, and every foreground is measured for contrast rather than assumed. Chart colors are spread around the hue wheel so series stay distinguishable, and --radius is carried through so your corner style survives the paste.
shadcn-theme.css
/*
Design system #47003A shadcn/ui theme
v1 · 9 Nov 2026 · source #47003a
Paste into your global stylesheet (Tailwind v4 + shadcn/ui).
*/
:root {
--background: oklch(0.994 0.004 337.4);
--foreground: oklch(0.186 0.027 338.8);
--card: oklch(0.996 0.002 345.2);
--card-foreground: oklch(0.186 0.027 338.8);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.186 0.027 338.8);
--primary: oklch(0.27 0.119 337.9);
--primary-foreground: oklch(1 0 0);
--secondary: oklch(0.629 0.118 127.4);
--secondary-foreground: oklch(0.205 0.018 339);
--muted: oklch(0.973 0.012 337.5);
--muted-foreground: oklch(0.426 0.024 339.4);
--accent: oklch(0.513 0.089 187.7);
--accent-foreground: oklch(1 0 0);
--destructive: oklch(0.584 0.16 24.8);
--border: oklch(0.9 0.013 337.6);
--input: oklch(0.9 0.013 337.6);
--ring: oklch(0.27 0.119 337.9);
--sidebar: oklch(0.967 0.012 337.5);
--sidebar-foreground: oklch(0.186 0.027 338.8);
--sidebar-primary: oklch(0.27 0.119 337.9);
--sidebar-primary-foreground: oklch(1 0 0);
--sidebar-accent: oklch(0.973 0.012 337.5);
--sidebar-accent-foreground: oklch(0.186 0.027 338.8);
--sidebar-border: oklch(0.925 0.009 341.8);
--sidebar-ring: oklch(0.27 0.119 337.9);
--chart-1: oklch(0.27 0.119 337.9);
--chart-2: oklch(0.269 0.063 158.2);
--chart-3: oklch(0.36 0.119 338.3);
--chart-4: oklch(0.36 0.085 157.6);
--chart-5: oklch(0.202 0.089 337.8);
--radius: 0.625rem;
}
.dark {
--background: oklch(0.148 0.011 341.7);
--foreground: oklch(0.944 0.014 336.2);
--card: oklch(0.196 0.012 338.5);
--card-foreground: oklch(0.944 0.014 336.2);
--popover: oklch(0.227 0.012 338.3);
--popover-foreground: oklch(0.944 0.014 336.2);
--primary: oklch(0.605 0.122 338.1);
--primary-foreground: oklch(0.166 0.016 336.9);
--secondary: oklch(0.62 0.118 127.4);
--secondary-foreground: oklch(0.166 0.016 336.9);
--muted: oklch(0.171 0.01 341.5);
--muted-foreground: oklch(0.72 0.012 339.4);
--accent: oklch(0.601 0.104 188.1);
--accent-foreground: oklch(0.166 0.016 336.9);
--destructive: oklch(0.75 0.151 24.7);
--border: oklch(0.301 0.011 338);
--input: oklch(0.301 0.011 338);
--ring: oklch(0.605 0.122 338.1);
--sidebar: oklch(0.178 0.013 338.6);
--sidebar-foreground: oklch(0.944 0.014 336.2);
--sidebar-primary: oklch(0.605 0.122 338.1);
--sidebar-primary-foreground: oklch(0.166 0.016 336.9);
--sidebar-accent: oklch(0.171 0.01 341.5);
--sidebar-accent-foreground: oklch(0.944 0.014 336.2);
--sidebar-border: oklch(0.263 0.009 341);
--sidebar-ring: oklch(0.605 0.122 338.1);
--chart-1: oklch(0.27 0.119 337.9);
--chart-2: oklch(0.269 0.063 158.2);
--chart-3: oklch(0.36 0.119 338.3);
--chart-4: oklch(0.36 0.085 157.6);
--chart-5: oklch(0.202 0.089 337.8);
--radius: 0.625rem;
}
Want the full design system from a color? Open the color palette generator to create accessible palettes, semantic tokens, light and dark themes, and production-ready CSS — all from a single color.
How to use this tool
- Enter your brand color.
- A complete shadcn/ui theme is generated in the current oklch convention — light and dark blocks, chart and sidebar variables included.
- Paste it into your global stylesheet in a Tailwind v4 + shadcn/ui project.
Frequently asked questions
- Does it output the current shadcn/ui token format?
- Yes — themes are emitted in oklch() with the current token set including chart-1…5 and sidebar variables, matching what recent shadcn/ui projects expect.
- Do I get both light and dark themes?
- Every generation produces a matched :root and .dark pair with accessible foregrounds, so switching modes never breaks contrast.
- How do I apply the theme?
- Paste the CSS into your global stylesheet (e.g. globals.css). The variables override shadcn's defaults everywhere — buttons, cards, dialogs and charts pick them up automatically.
- Will my brand color survive as the primary button color?
- Yes — the generator keeps your hue recognisable in --primary for both modes and adjusts lightness and chroma around it for legibility, rather than replacing it with a generic blue. If the exact brand hex must appear somewhere (a logo lockup, a marketing banner), use it as an accent alongside the theme primary.
Related tools
Related guides
Color scales · 12 Oct 2026
OKLCH explained for frontend developers
Hue, chroma, lightness: what each OKLCH channel does, why the space is perceptually uniform, and how to read and write oklch() values in real CSS.
Design systems · 5 Nov 2026
Exporting design systems to Tailwind, shadcn and CSS variables
One system, four dialects. How the design-system export produces Tailwind v4, shadcn/ui, CSS variables and W3C token files from the same colors.
Tutorials · 31 Oct 2026
Theme shadcn/ui with your brand in five minutes
Brand in, themed components out: shadcn variables that just work.
shadcn/ui theme generator runs entirely in your browser — nothing you enter is sent to a server.