$ recombobulate _
home / tips / migrate-your-tailwind-css-v2-classes-to-v4-with-claude
0

Migrate Your Tailwind CSS v2 Classes to v4 with Claude

bagwaa @bagwaa · Mar 26, 2026 · Workflows
migrate-your-tailwind-css-v2-classes-to-v4-with-claude

Tailwind v4 is a near-complete rewrite with breaking changes across utility names, config structure, and CSS variable conventions — a perfect job for Claude.

Ask Claude to handle the migration across your whole project at once:

claude "Migrate all Tailwind CSS classes in src/ from v2 to v4. Key changes: shadow-sm → shadow-xs, ring-offset-* is removed, flex-shrink-* → shrink-*, overflow-ellipsis → text-ellipsis, and decoration-clone/slice → box-decoration-clone/slice. Update every .tsx, .html, and .vue file."

For the config file, the change is more fundamental — tailwind.config.js is replaced by CSS-first configuration:

claude "Read tailwind.config.js and convert it to a v4 CSS theme block in src/styles/app.css. Map custom colours, font families, spacing values, and breakpoints to @theme variables. Preserve all custom values."

Claude can also handle the new @utility custom utilities syntax and update any PostCSS config:

claude "Update postcss.config.js for Tailwind v4 and replace any @apply directives in our CSS files that use renamed utilities."

If you have a design token system that feeds into Tailwind, Claude can bridge that too:

claude "Read design-tokens.json and generate the @theme block for our Tailwind v4 config, mapping colour, spacing, and typography tokens to the correct CSS variable names."

Tailwind v4 migrations are mechanical and tedious — exactly the kind of work Claude handles well so you don't have to.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 1 hour ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 1 hour ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago