Skip to main content

use-tailwind-v4

Tailwind CSS v4 syntax and v3→v4 migration reference. Use when the user mentions 'Tailwind v4', 'upgrade Tailwind', @theme, @utility, or @import 'tailwindcss', or is working in a project whose config indicates v4.

설치로 이동

소스 정보

저장소
nweii/agent-stuff
최근 소스 활동
2026년 5월 8일 21:59
감지된 SKILL.md 언어
영어
스타
10
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
use-tailwind-v4
description
Tailwind CSS v4 syntax and v3→v4 migration reference. Use when the user mentions 'Tailwind v4', 'upgrade Tailwind', @theme, @utility, or @import 'tailwindcss', or is working in a project whose config indicates v4.
# Tailwind CSS v4 ## v4 Syntax At a Glance ### Imports and Setup ```css /* 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()`: ```css background-color: var(--color-red-500); font-family: var(--font-sans); ``` ## Quick Reference: v3 → v4 Changes ### Renamed Utilities | v3 | v4 | Notes | |----|-----|-------| | `shadow-sm` | `shadow-xs` | Scale shifted | | `shadow` | `shadow-sm` | Scale shifted | | `drop-shadow-sm` | `drop-shadow-xs` | Scale shifted | | `drop-shadow` | `drop-shadow-sm` | Scale shifted | | `blur-sm` | `blur-xs` | Scale shifted | | `blur` | `blur-sm` | Scale shifted | | `backdrop-blur-sm` | `backdrop-blur-xs` | Scale shifted | | `backdrop-blur` | `backdrop-blur-sm` | Scale shifted | | `rounded-sm` | `rounded-xs` | Scale shifted | | `rounded` | `rounded-sm` | Scale shifted | | `outline-none` | `outline-hidden` | `outline-none` now sets `outline-style: none` | | `ring` | `ring-3` | Default changed from 3px to 1px | ### Deprecated Utilities (Use Opacity Modifiers) ```html <!-- 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-ellipsis` → `text-ellipsis` ### Default Changes | What | v3 Default | v4 Default | |------|------------|------------| | Border color | `gray-200` | `currentColor` | | Ring width | `3px` | `1px` | | Ring color | `blue-500` | `currentColor` | | Button cursor | `pointer` | `default` | ### Variant Stacking Order Changed from right-to-left to left-to-right: ```html <!-- v3 --> <ul class="first:*:pt-0"> <!-- v4 --> <ul class="*:first:pt-0"> ``` ### Variable Syntax in Arbitrary Values ```html <!-- v3: square brackets --> <div class="bg-[--brand-color]"> <!-- v4: parentheses --> <div class="bg-(--brand-color)"> ``` ### Prefix Syntax ```html <!-- 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: ```bash 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](references/upgrade-guide.md).
GitHub에서 보기