use-tailwind-v4

Tailwind CSS v4 reference and migration guide. Use for v4 projects, syntax changes, upgrading from v3, and troubleshooting v4-specific utility patterns or configuration differences.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "use-tailwind-v4" with this command: npx skills add nweii/agent-stuff/nweii-agent-stuff-use-tailwind-v4

Tailwind CSS v4

v4 Syntax At a Glance

Imports and Setup

/* v4 import (replaces @tailwind directives) */
@import "tailwindcss";

/* Custom utilities (replaces @layer utilities) */
@utility tab-4 {
  tab-size: 4;
}

/* Loading JS config (if still needed) */
@config "../../tailwind.config.js";

CSS Variables for Theme

v4 exposes all theme values as CSS variables. Prefer these over theme():

background-color: var(--color-red-500);
font-family: var(--font-sans);

Quick Reference: v3 → v4 Changes

Renamed Utilities

v3v4Notes
shadow-smshadow-xsScale shifted
shadowshadow-smScale shifted
drop-shadow-smdrop-shadow-xsScale shifted
drop-shadowdrop-shadow-smScale shifted
blur-smblur-xsScale shifted
blurblur-smScale shifted
backdrop-blur-smbackdrop-blur-xsScale shifted
backdrop-blurbackdrop-blur-smScale shifted
rounded-smrounded-xsScale shifted
roundedrounded-smScale shifted
outline-noneoutline-hiddenoutline-none now sets outline-style: none
ringring-3Default changed from 3px to 1px

Deprecated Utilities (Use Opacity Modifiers)

<!-- v3: opacity utilities -->
<div class="bg-black bg-opacity-50">

<!-- v4: opacity modifiers -->
<div class="bg-black/50">

Also: flex-shrink-*shrink-*, flex-grow-*grow-*, overflow-ellipsistext-ellipsis

Default Changes

Whatv3 Defaultv4 Default
Border colorgray-200currentColor
Ring width3px1px
Ring colorblue-500currentColor
Button cursorpointerdefault

Variant Stacking Order

Changed from right-to-left to left-to-right:

<!-- v3 -->
<ul class="first:*:pt-0">

<!-- v4 -->
<ul class="*:first:pt-0">

Variable Syntax in Arbitrary Values

<!-- v3: square brackets -->
<div class="bg-[--brand-color]">

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

Prefix Syntax

<!-- v4 prefixes are at the start, like variants -->
<div class="tw:flex tw:bg-red-500 tw:hover:bg-red-600">

Upgrading Projects

For project migrations, run the automated upgrade tool:

npx @tailwindcss/upgrade

Requires Node.js 20+. Run in a new branch and review changes.

For complete migration details (PostCSS/Vite/CLI config, custom utilities, framework-specific issues), see references/upgrade-guide.md.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

suggest-lucide-icons

No summary provided by upstream source.

Repository SourceNeeds Review
126-nweii
Automation

archive-conversation

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

aid-finances

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

validating-startup-ideas

No summary provided by upstream source.

Repository SourceNeeds Review