Tailwind CSS v4.1 core features, @theme, directives, migration guide
From fuse-tailwindcssnpx claudepluginhub fusengine/agents --plugin fuse-tailwindcssThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
| Namespace | Generated Utilities |
|---|---|
--color-* | bg-, text-, border-, fill- |
--font-* | font-* |
--text-* | text-xs, text-sm, text-base, etc. |
--spacing-* | p-, m-, gap-, w-, h-* |
--radius-* | rounded-* |
--shadow-* | shadow-* |
--breakpoint-* | sm:, md:, lg:, xl: |
--animate-* | animate-spin, animate-bounce, etc. |
--ease-* | ease-in, ease-out, ease-in-out |
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: { brand: '#3B82F6' }
}
}
}
@import "tailwindcss";
@theme {
--color-brand: #3B82F6;
}
@utility tab-4 {
tab-size: 4;
}
/* Usage: class="tab-4" */
.card {
@variant dark {
background: #1a1a2e;
}
}
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
/* Usage: dark:bg-gray-900 */
/* v3 */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* v4 */
@import "tailwindcss";
| v3 | v4 |
|---|---|
shadow-sm | shadow-xs |
shadow | shadow-sm |
rounded-sm | rounded-xs |
rounded | rounded-sm |
outline-none | outline-hidden |
ring | ring-3 |
bg-opacity-* → use bg-black/50text-opacity-* → use text-black/50flex-shrink-* → use shrink-*flex-grow-* → use grow-*/* v3 */
@layer utilities {
.tab-4 {
tab-size: 4;
}
}
/* v4 */
@utility tab-4 {
tab-size: 4;
}
<!-- v3 -->
<div class="bg-[--brand-color]"></div>
<!-- v4 -->
<div class="bg-(--brand-color)"></div>
<!-- v3 -->
<div class="!bg-red-500">
<!-- v4 -->
<div class="bg-red-500!">
npx @tailwindcss/upgrade
Requires Node.js 20+
npm install -D tailwindcss @tailwindcss/postcss
# or for Vite
npm install -D @tailwindcss/vite
# or for CLI
npm install -D @tailwindcss/cli
Adjust color opacity:
color: --alpha(var(--color-lime-300) / 50%);
Generate spacing values:
margin: --spacing(4);
Inline utility classes:
.btn {
@apply px-4 py-2 rounded-lg font-bold;
}