본문으로 건너뛰기
cccskills
무료GitHub에 공개

tailwind-v4

Write, review, and refactor styles using Tailwind CSS v4 conventions. Consult guidance on CSS configuration, renamed classes, built-in styling features, and behavior changes when updating older v3 code or creating new styles.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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.

설치 방법 보기

이럴 때 유용합니다

  • Updating Tailwind CSS v3 syntax for v4
  • Defining colors and spacing through CSS configuration
  • Reviewing classes and behavior changes
  • Using built-in features for interactive styles and animations

포함된 파일(1)

  • SKILL.md10.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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.

UseNever use (v3-era)
@import 'tailwindcss'@tailwind base/components/utilities
@theme { --color-x: ...; } for tokens that should generate utilitiestailwind.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 / safelistingcontent array / safelist config
@variant dark { ... } to apply a Tailwind variant inside custom CSSduplicating media queries / selectors
@reference "app.css" for @apply in scoped styles (Vue, CSS Modules)duplicating stylesheet imports
var(--color-x) in CSS, getComputedStyle in JStheme() function, resolveConfig
@config "…" / @plugin "…" only for existing JS-config integrationsadding 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:

v3v4
shadow-sm / shadowshadow-xs / shadow-sm
drop-shadow-sm / drop-shadowdrop-shadow-xs / drop-shadow-sm
blur-sm / blurblur-xs / blur-sm
rounded-sm / roundedrounded-xs / rounded-sm
outline-noneoutline-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-rbg-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 most v3-era arbitrary values have a named form:

Don'tDo
min-w-[400px], w-[600px]min-w-100, w-150
h-[1.5rem] w-[1.5rem]size-6
mt-[68px]mt-17
grid-cols-[repeat(15,minmax(0,1fr))]grid-cols-15
h-[100dvh], w-[100dvw], h-[1lh]h-dvh, w-dvw, h-lh
max-w-[80rem]max-w-7xl (container scale)
data-[current]:opacity-100data-current:opacity-100 (values keep brackets: data-[state=open]:)
bg-[var(--row-bg)]bg-(--row-bg); type hints when ambiguous: text-(color:--fg), text-(length:--size)

Square brackets remain correct for true one-offs: max-h-[calc(100dvh-3rem)], grid-cols-[200px_minmax(0,1fr)], and arbitrary properties like [mask-type:luminance].

Class strings must stay complete and statically detectable: map props to full strings ({ success: 'bg-positive1' }[tone]), never build fragments like `bg-${tone}-500`.

Don't hand-write CSS or JS for what a variant covers

Before writing a stylesheet rule, a style prop, or an event handler for styling, check for a variant:

Hand-writtenTailwind
.btn:active { ... } in CSSactive:bg-surface5
:focus-visible rulesfocus-visible:outline-accent1
[aria-expanded="true"] selectorsaria-expanded:rotate-180 (any aria-* boolean or value)
[data-state="open"] selectorsdata-[state=open]:opacity-100, boolean: data-current:
JS hover/focus state to style a sibling/childgroup/group-hover:, peer/peer-checked:, in-focus:
parent-state selectors / JS "has child" checkshas-checked:bg-accent1, has-[>svg]:pl-8
mask-image / fade-out gradients in CSSmask-b-from-80%, mask-t-from-*
@media (hover: none) blockspointer-coarse:/pointer-fine:
first/last/nth rules in CSSfirst:, last:, odd:, nth-3:, not-first:
styling all children from CSS*:rounded-full (children), **:data-avatar:rounded-full (descendants)

New capabilities — reach for these before hacks or JS

  • field-sizing-content — auto-growing textarea without a JS resize listener.
  • wrap-anywhere / wrap-break-word — long-word breaking inside flex without the min-w-0 hack.
  • items-center-safe, justify-center-safe — centering that falls back to start on overflow.
  • pointer-coarse: / pointer-fine: — adapt touch targets without user-agent sniffing.
  • user-valid: / user-invalid: — validation styling only after user interaction (unlike :valid).
  • starting: (+ transition-discrete for display/popover) — enter transitions without JS mount tricks.
  • text-shadow-*, mask-t-from-*/mask-b-to-* (fade-out edges), scheme-dark (native controls/scrollbars), 3D transforms (rotate-x-*, perspective-*).

Behavior changes to remember

  • Transforms use individual CSS properties: custom transition lists need transition-[opacity,scale], not transition-[opacity,transform]; reset with scale-none/rotate-none/translate-none.
  • hover: only applies on hover-capable devices (@media (hover: hover)) — never gate required touch functionality behind hover.
  • Default border-*, divide-*, ring, and outline colors are currentColor — set an explicit color when the color matters.
  • Variant stacking applies left to right: v3 first:*:pt-0 is now *:first:pt-0.
  • space-x/y-* changed selectors (:not(:last-child)); prefer flex/grid with gap-*.
  • Container queries are built in: @container on the parent, @sm:/@max-md: on children.
  • Useful v4 variants: starting: (enter transitions), not-*, in-* (like group-* without the group class), nth-*, *: (direct children), **: (descendants), inert:.

Motion

  • Gate decorative animation: motion-safe:animate-spin motion-reduce:animate-none.
  • Reusable animations are --animate-* tokens with their @keyframes inside @theme; local one-offs use animate-(--local-animation) or animate-[...].

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Design and audit an agent's system prompt, the instructions that guide its work. Define a concrete outcome, starting input, available tools, completion checks, fallback behavior, and final report so the prompt describes a complete run.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Designing the core instructions for a new agent
  • Auditing a prompt before saving it
  • Defining behavior when tools or permissions are missing
mastra-ai/mastra2.9만2026년 10월 18일 업데이트

Create a dedicated test project linked to the current worktree and check Agent Builder through APIs and browser interactions. It covers agent and skill management, permissions, defaults, and related features, with selectable test sections.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Validate an Agent Builder feature branch before review
  • Check role-based permissions and authentication
  • Test agent and skill management through APIs and the UI
mastra-ai/mastra2.9만2026년 10월 18일 업데이트

Reviews pull requests for bugs, error handling, code quality, and style consistency. Organizes feedback into an overview, must-fix issues with file locations, improvement suggestions, and positive notes so reviewers can distinguish urgent problems from refinements.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Finding bugs that must be fixed before merging
  • Reviewing TypeScript types and asynchronous code
  • Checking naming, imports, and leftover debug statements
mastra-ai/mastra2.9만2026년 10월 18일 업데이트

Design instructions for agents that write, fix, review, or refactor code. Define behavior based on file access, select suitable tools, and set clear verification and completion rules for repository changes or copyable code output.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Designing an agent for repository bug fixes
  • Defining a pull request review agent
  • Creating a code generator without workspace access
mastra-ai/mastra2.9만2026년 10월 18일 업데이트

Configure Factory board behavior and GitHub or Linear event handlers in deployment code. Adjust stage transitions, phase meanings, and tool-result handling, then check the changes with focused tests and versioned audit records.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Add approval requirements to board transitions
  • Change GitHub or Linear event handling
  • Define custom board phases and tool-result rules
mastra-ai/mastra2.9만2026년 10월 18일 업데이트

Design agents that draft blog posts, social posts, newsletters, and marketing copy. Define the audience, brand voice, length, and required output so each agent delivers a complete draft with a headline and supporting notes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Build a blog writing agent with a consistent brand voice
  • Design an agent for LinkedIn product posts
  • Define delivery rules for newsletter drafts
mastra-ai/mastra2.9만2026년 10월 18일 업데이트

mastra-ai의 스킬 모두 보기

이 스킬의 문제 신고