Theme Studio

A live editor for shadcn/ui themes that scores contrast as you pick: presets, a full colour picker, shareable links and paste-ready OKLCH.

Role
Sole designer and developer
Team
Solo project
Platform
Web app, no backend
Status
Concept · Live
Visit the live site ↗
Theme Studio with the Ivory preset: token rows with contrast results beside a live preview of shadcn components
01 At a glance

The 30-second version.

Problem

Retheming shadcn/ui meant editing colour tokens, reloading and guessing, and nothing told you the label on your new button failed contrast.

What I did

Built a live editor, then audited it at 1440 and 390 px and rebuilt the weakest parts: a full picker, OKLCH with alpha as the stored value, contrast on every token row and a phone layout built on sheets.

Outcome

A browser-only theme editor that scores 13 real component pairings live, fixes a failing one in a click, and exports paste-ready CSS, Tailwind v4 or JSON.

Presets
5
Theme vars
19
Contrast pairs
13
Backend
0
02 The problem

Edit, reload, guess, repeat.

A shadcn/ui theme is nineteen colour variables. Changing them by hand means reloading and guessing how every component will look, and whether the text on it can still be read.

  • Who: developers retheming a shadcn/ui project.
  • Constraint: the export has to paste straight back into a project.
  • Risk: a picker that makes any colour easy to choose, including the ones that fail WCAG.
03 My role

What I owned.

What I owned

  • Audit, interaction and visual design
  • Colour maths, contrast and export
  • Frontend, and QA at desktop and phone sizes
04 Process

How it came together.

  1. Audit

    Captured eleven states at 1440 and 390 px and ranked ten problems by user impact, starting with a picker that had no alpha and no formats.

    Wireframe of the first Theme Studio editor with numbered pins on its ranked problems: the picker, the auto-expanding contrast report, small token rows, the export and a pulsing marker
  2. Picker

    Alpha, an eyedropper where the browser has one, four formats and saved swatches, built onto the picker already in the app.

    Wireframe of the colour picker with saturation, hue and opacity, an eyedropper, a format menu set to OKLCH and saved swatches, beside the same picker as a phone sheet
  3. Contrast

    Thirteen pairings read from what the components actually paint, scored on every row, with a one-click fix that only moves lightness.

    Diagram of the contrast pairings with ratios and AA and AAA results, three failing rows, a lightness fix from 60% to 51% and a token that is never read, struck out
  4. Phone

    Preview first, shorter preset cards, and a picker that takes over the sheet instead of floating on top of it.

    Wireframe of three phone screens: the live preview with Customize and Export, the customize sheet with token rows and contrast badges, and the picker as its own sheet
Insight → design

The preview changes; the editor doesn't.

Your theme is applied as scoped variables on ten real shadcn components, while the editor's own chrome keeps a fixed palette, so there is always a stable reference to judge colours against. Compare puts light and dark side by side.

Theme Studio in Compare mode: the Ivory theme's light and dark previews side by side, each with its own AA score
Insight → design

OKLCH inside, any format at the edges.

The theme is stored as OKLCH with alpha. The picker takes hex, RGB, HSL or OKLCH, and the CSS, Tailwind v4 and JSON exports all write oklch() values, while links shared back when the app stored HSL still open.

Theme Studio colour picker open on Button color, with saturation, hue and opacity sliders, an eyedropper, a format menu and five saved swatches
Insight → design

A score you can check.

Every token row shows its worst AA and AAA result, and the report explains each pairing. The presets ship as designed, failures included: Ivory light passes 10 of 13, and one fix on the muted text takes it to 13.

Theme Studio accessibility report open in the sidebar: pairings such as body text and the label on primary buttons, each with its contrast ratio and AA and AAA badges
05 Key decisions

What I chose, and what it cost.

Open any decision to see the alternative and the price I paid for it.

Instead ofHSL triplets, the format shadcn themes were first written in and the one the app shipped with.
BecauseTailwind v4 themes are written in OKLCH, and alpha now survives from the picker all the way to the pasted CSS.
The costTwo parsers for good: links shared before the switch are HSL, and they still have to open.
Instead ofPairing every token with the -foreground token whose name matches it.
BecauseThe destructive button paints tinted text, so --destructive-foreground is never read. Scoring it would have shipped a badge that measures nothing.
The costThe list is kept by hand. When a component changes how it paints, the pairings have to be read again.
Instead ofQuietly correcting the presets before turning the audit on.
BecauseA checker that only ever shows green isn’t measuring anything, and the one-click fix gets shown straight away.
The costThe first thing a visitor sees on the default theme is a red “10/13 pass AA”.
06 Outcome

What shipped.

Product film
The first Theme Studio editor: preset gallery, small token rows with hex fields, and the live previewThe revamped Theme Studio editor: token rows with a swatch, a value and contrast results under each, beside the live previewBeforeAfter
⇆
Drag to compare. The editor before and after the audit, both at 1440 px.
Component pairings scored live
13
Colour formats the picker takes
4
Backend services
0
Visit the live site ↗
  1. InputPicker + presetsHex, RGB, HSL or OKLCH, with alpha
  2. StateOKLCH source of truthPer mode, contrast scored, diffed to URL
  3. OutputExport + shareCSS, Tailwind v4, JSON, shareable URL

One static Next.js App Router page renders a single client component. There is no API route, no database and no auth anywhere in the tree. A theme is a plain in-memory object: a name plus a light and a dark record of nineteen colours, stored as canonical OKLCH with alpha and produced by five presets or a seed generator. Edits apply to the preview immediately, while URL writes are debounced and hold only what differs from the preset, and the parser still reads links from the HSL era. Contrast uses the WCAG relative-luminance formula with alpha composited over its background, and the fix searches along OKLCH lightness for the smallest change that passes without breaking a pairing that already passes. Saved swatches live in local storage behind a guard; the only other persistence is the URL.

  • Next.js
  • TypeScript
  • Tailwind
  • shadcn/ui
  • react-colorful
07 Reflection

What I'd change, and what I'd keep.

I'd do differently

Measure the preview's render time instead of assuming it, test the colour conversions with unit tests rather than by hand, and make the radius token editable.

I'd keep

One canonical value per colour, driving the preview, the contrast maths and every export.

Next case studyPlotWiseOne inventory system for R&D test plots that had none: every item, litre of fuel and chemical application traced to where it went.

Open to full-time product design and full-stack development roles. Let's build something people rely on.

javiertpga@gmail.com