shadcn/ui theme generator
Enter your brand color and get a complete shadcn/ui theme for light and dark mode, where every text pair passes WCAG AA.
How to use it
- Enter your brand color as hex, rgb(), hsl() or a color name.
- Check the light and dark previews and the contrast lists below them.
- Switch between Light and Dark to see and copy each variable.
- Copy the CSS into your globals.css, replacing the existing :root and .dark blocks. The page address updates, so you can share the theme.
How it works
Backgrounds, borders and muted colors are near-neutrals tinted with your brand's hue, so the theme feels related instead of plain gray. Values are written in OKLCH, the format current shadcn/ui themes use.
Your brand color becomes the primary color, adjusted only in lightness as much as needed for its text to reach 4.5:1. Muted text gets the same check, against both the muted background and the page.
Related tools
Questions
Where do I paste the CSS?
Into the globals.css file of a shadcn/ui project, replacing the :root and .dark blocks it already has. Components pick up the new colors right away.
Why does the primary color look different in dark mode?
On a dark background, a dark brand color would be hard to see, so dark mode lightens it just enough to pass AA. Its hue stays the same.
Does this cover charts and the sidebar?
It covers the core variables every component uses. Chart and sidebar variables can be added from your palette; the palette generator can export a shadcn/ui block from any palette.