Color Themes for BasecoatUI & shadcn/ui

Convert any tinted-theming base24 color scheme into a shadcn/ui / Basecoat UI CSS theme. One command, 190+ schemes, zero dependencies.

Open Gallery GitHub β†—

Quick Start

No install β€” open the gallery, pick a theme, download:

🎨 Visit Gallery β†’ choose a scheme β†’ πŸ“₯ Download CSS

Or use the CLI β€” convert a base24 scheme YAML to a shadcn/ui theme.css:

bun src/cli.ts scheme.yaml -o theme.css

From a URL with a preview:

bun src/cli.ts https://raw.githubusercontent.com/.../one-dark.yaml -o theme.css --preview

Use magenta as the primary color:

bun src/cli.ts scheme.yaml -p base0E

Run the dev server (localhost only):

bun src/server.ts

Opens at http://localhost:3001 β€” gallery, Basecoat UI proxy (localhost only), CSS API.

How It Works

🎨

24 Colors β†’ 30 Tokens

Each base24 slot maps to a semantic shadcn token. base00 becomes --background, base0D drives --primary. Charts, sidebar, destructive β€” all mapped.

πŸ”¬

Hex β†’ oklch

Full BjΓΆrn Ottosson conversion inline β€” sRGB linearization, D65 XYZ matrix, LMS transform, cube root, oklch output. No dependencies.

πŸŒ“

Auto Light/Dark

Detects scheme mode from variant field or luminance. Auto-generates the opposite variant β€” neutral axis swap, capped chroma, adjusted lightness.

Token Mapping

shadcn token base24 slot Rationale
--backgroundbase00Default background (darkest)
--foregroundbase05Primary text color
--cardbase01Elevated surface
--primarybase0D ✦Brand/action color (overridable)
--secondarybase02Selection background
--mutedbase01Subdued surface
--destructivebase08Errors, destructive actions
--borderbase03Subtle borders
--ringbase0D ✦Focus ring (follows primary)
--sidebarbase10Darker sidebar background

✦ = configurable via --primary flag. Also changes --ring, --chart-1, --sidebar-primary.

Technologies

Bun

Runtime β€” fast TS execution, built-in HTTP server, zero-config.

Basecoat UI

Component library β€” shadcn/ui for any web stack. CDN at unpkg.com/basecoat-css@1.0.1.

Tailwind CSS

v3 Play CDN for gallery, v4 compiled in Basecoat's style packs. Cascade fixes for v3/v4 layer conflicts.

oklch color space

Perceptually uniform. BjΓΆrn Ottosson's conversion: sRGB β†’ linear β†’ XYZ D65 β†’ LMS β†’ oklch.

tinted-theming

190+ base24 schemes from spec-0.11. Fetched from GitHub API, parsed inline.

Zero Dependencies

No npm packages. YAML parsed with regex, oklch conversion inline, HTML generated from templates.

Motivation

The tinted-theming project maintains hundreds of meticulously crafted color schemes β€” battle-tested across terminals, editors, and applications for over a decade.

Meanwhile, shadcn/ui theming uses CSS custom properties in oklch() β€” a modern, perceptually uniform color space. But there was no bridge between these two worlds.

base24-to-shadcn is that bridge. It takes any base24 scheme, converts every hex color to oklch via the BjΓΆrn Ottosson algorithm, and maps the 24 terminal slots to shadcn's 30 semantic design tokens. The result: instant, production-ready CSS themes that work with Basecoat UI, shadcn/ui, and any Tailwind CSS project.