Skip to main content

tailwindcss-v4

Tailwind CSS v4.1 core features, @theme, directives, migration guide

Stars
13
Source
fusengine/agents
Updated
2026-05-17
Slug
fusengine--agents--tailwindcss-v4
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/fusengine/agents/HEAD/plugins/tailwindcss/skills/tailwindcss-v4/SKILL.md -o .claude/skills/tailwindcss-v4.md

Drops the SKILL.md into .claude/skills/tailwindcss-v4.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

Tailwind CSS v4.1 Core

Documentation

Quick Reference - @theme Namespaces

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

v3 → v4 Breaking Changes

Removed @tailwind directives

/* v3 */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* v4 */
@import "tailwindcss";

Renamed utilities

v3 v4
shadow-sm shadow-xs
shadow shadow-sm
rounded-sm rounded-xs
rounded rounded-sm
outline-none outline-hidden
ring ring-3

Removed deprecated utilities

  • bg-opacity-* → use bg-black/50
  • text-opacity-* → use text-black/50
  • flex-shrink-* → use shrink-*
  • flex-grow-* → use grow-*

Custom utilities syntax

/* v3 */
@layer utilities {
  .tab-4 {
    tab-size: 4;
  }
}

/* v4 */
@utility tab-4 {
  tab-size: 4;
}

Variables in arbitrary values

<!-- v3 -->
<div class="bg-[--brand-color]"></div>

<!-- v4 -->
<div class="bg-(--brand-color)"></div>

Important modifier position

<!-- v3 -->
<div class="!bg-red-500">

<!-- v4 -->
<div class="bg-red-500!">

Upgrade Tool

npx @tailwindcss/upgrade

Requires Node.js 20+

Detailed References

  • configuration.md - Load when writing CSS-first @theme config or using @utility/@variant/@custom-variant directives
  • api-functions.md - Load when using the --alpha()/--spacing() CSS functions or @apply
  • installation-support.md - Load when installing Tailwind v4 (npm/Vite/CLI) or checking browser support