Tailwind v4 Theme Builder
Tailwind v4 Theme Builder
Compose an @theme CSS block — colors, spacing, fonts, breakpoints, container sizes — and copy the output.
Colors
Token Preview
Generated CSS
@import "tailwindcss";
@theme {
--color-primary: #10b981;
--color-accent: #8b5cf6;
--color-surface: #f4f4f5;
--color-ink: #18181b;
--spacing-1: 0.25rem;
--spacing-2: 0.5rem;
--spacing-4: 1rem;
--spacing-8: 2rem;
--font-sans: Inter, ui-sans-serif, system-ui, sans-serif;
--font-mono: JetBrains Mono, ui-monospace, monospace;
--breakpoint-sm: 40rem;
--breakpoint-md: 48rem;
--breakpoint-lg: 64rem;
--breakpoint-xl: 80rem;
--container-xs: 20rem;
--container-sm: 24rem;
--container-md: 28rem;
}
@layer base {
@media (prefers-color-scheme: dark) {
:root {
--color-primary: #34d399;
--color-accent: #a78bfa;
--color-surface: #18181b;
--color-ink: #fafafa;
}
}
}What This Tool Does
Tailwind v4 Theme Builder is built for deterministic developer and agent workflows.
Compose a Tailwind v4 @theme block with design tokens — colors, spacing, fonts, breakpoints, container sizes — preview swatches and dark-mode pairing, export the CSS variable bundle.
Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.
Last updated:
This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.
Agent Invocation
Best Path For Builders
Browser workflow
Runs instantly in the browser with private local processing and copy/export-ready output.
Browser Workflow
This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.
/tailwind-v4-theme-builder/
For automation planning, fetch the canonical contract at /api/tool/tailwind-v4-theme-builder.json.
How to Use Tailwind v4 Theme Builder
- 1
Add color tokens
On the Colors tab, define your palette names (primary, accent, surface, ink). Each token gets a light hex and a dark hex paired together for prefers-color-scheme support.
- 2
Build the spacing scale
Switch to the Spacing tab to add steps. Set the token name and a CSS length value (rem, px, em). The preview renders bars proportional to the value so you can spot uneven scales.
- 3
Define fonts, breakpoints, containers
Use the Fonts, Breakpoints, and Containers tabs to fill out the rest of the design system. Container sizes drive Tailwind v4's @container utilities for component-level breakpoints.
- 4
Toggle dark pairing and copy
Toggle the dark-mode checkbox to wrap dark hex values in a prefers-color-scheme media query. Press Copy on the Generated CSS panel to grab the @theme block.