Case study · Personal project
Thema
A design system generator that blends the websites you admire into one original, accessible design system that AI coding agents can follow.

- Role
- Solo developer
- Type
- Personal project
- Timeline
- Nov 2026
- Status
- Live
Overview
AI coding agents build better interfaces when they have a design system to follow, but writing one from scratch is slow. Thema starts from sites you already like: paste up to five, choose what each one lends (colors, type, spacing, shape or layout), tune the blend, and export it.
The result comes out as a DESIGN.md, a Tailwind v4 theme, a shadcn/ui theme, DTCG tokens and a style guide, and every color pair meets WCAG AA in both light and dark mode.
Key features
Extract from real sites
A headless browser loads each site, scrolls through it and records the computed styles of its visible elements. Only measurements are kept, never the site's HTML, images or fonts.
Blend references
Each site lends the parts you assign to it: colors from one, type from another, spacing from a third.
Tune the result
Four sliders adjust density, roundness, contrast and warmth, and locks keep the values you like.
Accessibility fixer
Foreground colors are adjusted until every checked pair reaches WCAG AA, and the missing light or dark theme is generated.
Five export formats
DESIGN.md, a Tailwind v4 theme, a shadcn/ui theme, DTCG design tokens and a style guide.
Built for agents
A CLI and an MCP server expose extract, blend and get_design_md tools, so AI coding agents can use Thema directly.
Highlights
A deterministic engine
The engine that turns samples into a design system is pure TypeScript with no network, clock or randomness. The same input always gives the same tokens, so every rule is testable.
Measured accuracy
Extraction is checked against 19 recorded real sites: the primary color, font families and spacing base are right in 56 of 57 checks (98.2%).
A fenced browser
Loading any URL a user pastes is risky, so one shared package applies the same SSRF rules in the web app, the worker, the CLI and the MCP server, and the browser runs behind a request fence.
Runs on free hosting
Extraction runs in serverless functions with a Lambda build of Chromium, one job at a time with a daily cap. Jobs and limits live in Neon Postgres, and saved screenshots in Cloudflare R2.
Screenshots
Built with
- Frontend
- Next.js (App Router), React, Tailwind CSS v4, shadcn/ui
- Extraction
- Playwright, Chromium for serverless
- Design engine
- TypeScript, culori (OKLCH color), Zod
- Backend & Data
- Better Auth, PostgreSQL (Neon), BullMQ, Redis, Cloudflare R2
- Testing
- Vitest, Testing Library, axe-core, DESIGN.md linter
- Tooling & Hosting
- pnpm workspaces, Turborepo, Vercel