Theming
ui26 uses the same CSS variable token contract as shadcn/ui — --background, --primary, --foreground, and so on. The styling layer is tailwind-variants instead of CVA, but the token names are identical.
Token palette
Section titled “Token palette”These are the semantic color tokens every ui26 theme defines. Toggle the theme picker (top-right) to see them switch live.
Already on shadcn?
Section titled “Already on shadcn?”Your existing theme works as-is. Install any ui26 component and it picks up your CSS variables automatically — nothing to configure.
If you want to try a different palette, see available themes below.
Starting fresh
Section titled “Starting fresh”If you don’t have a shadcn theme set up, install one before adding components. Without it, the CSS variables are undefined and components won’t look right.
Single theme
Section titled “Single theme”One palette on :root. Light/dark handled by .dark on <html>. This is what most projects want.
npx shadcn@latest add https://winston-ui26.netlify.app/r/themes/shad.jsonTheme switcher
Section titled “Theme switcher”All themes as separate CSS files, each scoped to [data-theme="<name>"]. Use this if you want a runtime theme picker.
npx shadcn@latest add https://winston-ui26.netlify.app/r/themes.jsonAdd one line to your global stylesheet:
@import './styles/themes/all-themes.css';Set data-theme on <html> to switch:
| Value | Result |
|---|---|
editorial | editorial light |
editorial-dark | editorial dark |
shad | default light (also :root fallback) |
Available themes
Section titled “Available themes”shad · editorial · tix · neon-synthwave · cyberpunk-neon · pastel-kawaii · zen-garden · bubblegum-pop · retro-arcade · tropical-paradise · steampunk-cogs · space-odyssey · vintage-vinyl · misty-harbor
Theme picker UI
Section titled “Theme picker UI”The docs site ships a working picker. It’s not extracted into a standalone package yet, but you can copy it from the repo:
ThemeProvider.astro— pre-paint script that readslocalStorageand setsdata-themebefore first render (no flash)theme-picker.tsx— dropdown + light/dark/auto toggle
Add your theme keys to the THEMES array in each file.
Custom themes
Section titled “Custom themes”Create a CSS file with two blocks: one for light, one for dark. The dark block only needs tokens whose values actually change — everything else cascades from the light block.
[data-theme="sunset"] { --font-sans: "Inter", system-ui, sans-serif; --font-serif: ui-serif, Georgia, serif; --font-mono: ui-monospace, Menlo, monospace;
--background: oklch(0.98 0.02 60); --foreground: oklch(0.2 0.05 30); /* ... full token contract */
--radius: 0.5rem;
--shadow-color: 30 20 10; --shadow-xs: 0 1px 1px rgb(var(--shadow-color) / 0.05); /* ... sm / md / lg / highlight-inset */}
[data-theme="sunset-dark"] { --background: oklch(0.14 0.04 30); --foreground: oklch(0.96 0.02 60); /* ... only what flips for dark */}For a single-theme setup, replace [data-theme="sunset"] with :root and .dark for the dark block.
Import in your global stylesheet:
@import './themes/sunset.css';Token contract
Section titled “Token contract”Every theme must define all of these. Shadows must be explicitly none — never omit them.
Surfaces
--background --foreground --card --card-foreground --popover --popover-foreground
Interactive
--primary --primary-foreground --secondary --secondary-foreground --muted --muted-foreground --accent --accent-foreground
Feedback
--destructive --destructive-foreground --success --warn --info --purple
Structure
--border --border-soft --input --ring --radius
Text / code
--accent-ink --accent-soft --text-mute --code
Shadows
--shadow-color --shadow-xs --shadow-sm --shadow-md --shadow-lg --highlight-inset
Fonts (only if your theme diverges from the default stack)
--font-sans --font-serif --font-mono