last update
Jun 24, 2026
license
MITv1.0.0
format
SKILL.md
- Install
// Downloads SKILL.md into ~/.claude/skills/tailwind-v4-oxide-css/
$ curl -fsSL --create-dirs -o ~/.claude/skills/tailwind-v4-oxide-css/SKILL.md https://claudeskil.com/skills/tailwind-v4-oxide-css/SKILL.md - Invoke
// Inside Claude Code, type the skill name as a slash command
> /tailwind-v4-oxide-css give my landing page a hero treatment - Or just ask
// Claude loads the skill by itself when a request matches its description
> give my landing page a hero treatment
- name:
- Tailwind v4 Migrator
- slug:
- tailwind-v4-oxide-css
- version:
- v1.0.0
- license:
- MIT
- author:
- @chiragthummar16
- categories:
- tags:
- #tailwind-v4#oxide#css-first#shadcn#vite
- description:
Migrate v3 to Tailwind v4 Oxide, author CSS-first @theme tokens, wire the Vite/PostCSS plugin, ship shadcn variants.
// What you can do with it
- Runs npx @tailwindcss/upgrade (the codemod that rewrites utility class renames like shadow-sm → shadow-xs and outline-none → outline-hidden).
- Replaces the three @tailwind base; @tailwind components; @tailwind utilities; directives with a single @import "tailwindcss";.
- Translates theme.extend values into a CSS-first @theme { --color-, --font-, --spacing-* } block so tokens become real custom properties.
- Wires the build: @tailwindcss/vite in vite.config.ts, or @tailwindcss/postcss in postcss.config.mjs for Next.js/Webpack. Removes the old tailwindcss + autoprefixer PostCSS entries (v4 handles prefixin
- Ports custom utilities to @utility, plugins to @plugin, and converts dark mode to @custom-variant dark (&:where(.dark, .dark *));.
README.md
Tailwind v4 Migrator
Move a Tailwind CSS v3 codebase to the v4 Oxide engine without leaving broken classes or a stale config behind. This skill runs the official upgrade tool, rewrites your CSS entry to the CSS-first model, swaps in the right build plugin for your bundler, and repairs shadcn/ui setups that assumed tailwind.config.js. It is aimed at frontend engineers maintaining real apps on Vite, Next.js, or a PostCSS pipeline.
When to use it
- You have a working v3 project and want the faster Oxide engine plus native cascade-layer output.
npx @tailwindcss/upgraderan but left@applyerrors, missing CSS variables, or atailwind.config.jsthat nothing reads anymore.- Your shadcn/ui components stopped theming correctly after the bump (the
hsl(var(--...))token plumbing changed). - You are starting fresh on v4 and want a clean
@themeblock instead of porting a JS config.
What it does
- Runs
npx @tailwindcss/upgrade(the codemod that rewrites utility class renames likeshadow-sm→shadow-xsandoutline-none→outline-hidden). - Replaces the three
@tailwind base; @tailwind components; @tailwind utilities;directives with a single@import "tailwindcss";. - Translates
theme.extendvalues into a CSS-first@theme { --color-*, --font-*, --spacing-* }block so tokens become real custom properties. - Wires the build:
@tailwindcss/viteinvite.config.ts, or@tailwindcss/postcssinpostcss.config.mjsfor Next.js/Webpack. Removes the oldtailwindcss+autoprefixerPostCSS entries (v4 handles prefixing). - Ports custom utilities to
@utility, plugins to@plugin, and converts dark mode to@custom-variant dark (&:where(.dark, .dark *));.
Usage
curl -fsSL --create-dirs -o ~/.claude/skills/tailwind-v4-oxide-css/SKILL.md https://claudeskil.com/skills/tailwind-v4-oxide-css/SKILL.md
# then, in your project:
claude "migrate this app to Tailwind v4"
Resulting CSS entry:
@import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));
@theme {
--color-brand: oklch(0.62 0.19 256);
--font-display: "Inter", sans-serif;
}
@utility tap-highlight-none {
-webkit-tap-highlight-color: transparent;
}
Tips & gotchas
- v4 needs a modern target (Safari 16.4+, Chrome 111+); it emits
oklch()and@property. Don't migrate if you must support older browsers. @themekeys are namespaced —--color-brandgeneratesbg-brand/text-brandautomatically. Arbitrary CSS vars under:rootdo not create utilities; only@themedoes.- Keep
@importlines first. Anything before@import "tailwindcss";breaks the cascade-layer ordering silently. - For shadcn, regenerate
components.json-driven tokens; the v3hsl(var(--background))pattern still works but new components expect the v4 layout.
FAQ
Do I still need a JS config? No. @config "./tailwind.config.js"; is supported for gradual migration, but the target is a fully CSS-first setup with no JS config.
Is autoprefixer still required? No. Oxide includes vendor prefixing and @import inlining, so you remove both autoprefixer and postcss-import.
Will the codemod touch my components? It rewrites renamed utility classes in your templates and CSS. Review the diff — custom class strings built at runtime won't be caught.
$ cat reviews/