본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)29k · #9366

tailwind-v4

하는 일

이 스킬은 Tailwind CSS 버전 4 코드를 올바르게 작성하는 가이드입니다. 새 코드에 나타나면 안 되는 버전 3의 오래된 패턴을 짚어 줍니다.

사용하는 경우

  • ✓프로젝트에서 Tailwind 스타일을 작성하거나 바꿀 때.
  • ✓오래된 Tailwind 버전 3 코드를 버전 4로 옮기고 싶을 때.
  • ✓새 설정 방식으로 사용자 정의 테마 색상을 설정하고 싶을 때.

스킬 링크

https://github.com/mastra-ai/mastra/blob/main/.claude/skills/tailwind-v4/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mastra-ai/mastra/blob/main/.claude/skills/tailwind-v4/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 컴포넌트의 스타일을 Tailwind 버전 4 문법으로 바꾸고, 오래된 버전 3 패턴은 제거해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 JavaScript 설정 파일 대신 Tailwind 버전 4의 CSS 기반 설정을 사용하며, 프로젝트가 고정한 버전에 유틸리티가 있는지 사용하기 전에 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Tailwind CSS v4

How to write idiomatic Tailwind v4 and spot v3-era syntax that still compiles but should not appear in new code.

Version and sources

Check the pinned version before using recent utilities: the playground packages pin tailwindcss in their package.json (4.3.3 at the time of writing, including v4.3 utilities like scrollbar-*, zoom-*, and tab-*). When unsure whether a utility, variant, or directive exists in the pinned version, verify against the docs instead of guessing:

CSS-first configuration

Tailwind v4 is configured in CSS, not JavaScript.

Use Never use (v3-era)
@import 'tailwindcss' @tailwind base/components/utilities
@theme { --color-x: ...; } for tokens that should generate utilities tailwind.config.ts for new work
@utility name { ... } for custom utilities (works with variants) @layer utilities { .name { ... } }
@custom-variant dark (&:is(.dark *)) JS plugins / addVariant
@source "path" / @source inline("...") for extra sources / safelisting content array / safelist config
@variant dark { ... } to apply a Tailwind variant inside custom CSS duplicating media queries / selectors
@reference "app.css" for @apply in scoped styles (Vue, CSS Modules) duplicating stylesheet imports
var(--color-x) in CSS, getComputedStyle in JS theme() function, resolveConfig
@config "…" / @plugin "…" only for existing JS-config integrations adding new JS configs or plugins

@theme variables are API: each one emits a native CSS variable AND generates utilities (--color-* → bg-*/text-*/border-*/..., --text-* → text-*, --shadow-* → shadow-*, --animate-* → animate-*, --breakpoint-* → responsive variants). A plain :root { --x: ...; } variable generates nothing — use it for runtime-only values. When a token's value references another variable (--color-x: var(--y)), declare it in @theme inline so the utility resolves the reference at the declaration site. In custom CSS, --alpha(var(--color-x) / 50%) and --spacing(4) replace v3 theme() math.

v3 → v4 renames

Bare names shifted one step down the scale, so the v3 spelling silently renders smaller or lighter:

v3 v4
shadow-sm / shadow shadow-xs / shadow-sm
drop-shadow-sm / drop-shadow drop-shadow-xs / drop-shadow-sm
blur-sm / blur blur-xs / blur-sm
rounded-sm / rounded rounded-xs / rounded-sm
outline-none outline-hidden (a11y-safe); outline-none now truly removes it
ring (3px) ring-3; the default ring is now 1px currentColor
bg-opacity-50, text-opacity-* opacity modifier: bg-black/50, text-white/50
bg-gradient-to-r bg-linear-to-r (plus new bg-conic-*, bg-radial-*)
!bg-red-500 (prefix) bg-red-500! (suffix)
flex-shrink-* / flex-grow-* shrink-* / grow-*
bg-[--var] bg-(--var); brackets now require bg-[var(--var)]
grid-cols-[a,b] (commas) underscores: grid-cols-[max-content_auto]

Prefer generated utilities over arbitrary values

The spacing scale is infinite — every number compiles via calc(var(--spacing) * n) — so mo

자주 묻는 질문

프로젝트에 아직 tailwind 설정 파일이 필요한가요?

새 작업에서는 설정을 JavaScript 설정 파일 대신 CSS로 작성합니다.

어떤 기능을 쓸 수 있는지 어떻게 알 수 있나요?

프로젝트가 고정한 Tailwind 버전을 확인하고, 확실하지 않으면 공식 문서를 참고합니다.

예전 문법은 깨졌나요?

대부분 여전히 컴파일되지만, 이 스킬은 새 코드가 그쪽으로 가지 않도록 안내합니다.

상세 정보

작성자의 원본 설명

Tailwind CSS v4 usage guide and v3-to-v4 differences. This skill should be used when writing, reviewing, or refactoring any Tailwind CSS code in this repo. Triggers on tasks involving Tailwind classes, @theme blocks, CSS-first configuration, or cleanup of v3-era syntax.

repo: mastra-ai/mastra

인기도

GitHub 스타
29k
순위
#9366
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬