tailwind-v4

tailwind-v4 is a skill for Claude Code, Codex from recca0120/code-quest. It costs 102 tokens per session (5,041 once invoked), scanned A, original, MIT.

A Tailwind CSS v4 styling guide for defining design tokens and custom utilities directly in CSS. It covers the newer CSS-first setup and migration from Tailwind v3.

In plain words
What is it for?
Use it when styling components, configuring shared design tokens, adding custom utilities or variants, migrating from Tailwind v3, or replacing hardcoded colors with theme tokens.
Why use it?
It reduces confusion when moving from configuration files to Tailwind v4’s CSS-based approach. It also helps keep colors, spacing, and other design values consistent instead of scattering one-off values through components.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/recca0120/code-quest/tailwind-v4
Any agent
npx skills add recca0120/code-quest --skill tailwind-v4
Clone the repo
git clone --depth 1 https://github.com/recca0120/code-quest

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tailwind-v4

README.md
[![agentmods](https://agentmods.dev/badge/skills/recca0120/code-quest/tailwind-v4.svg)](https://agentmods.dev/skills/recca0120/code-quest/tailwind-v4)
Your own site
<a href="https://agentmods.dev/skills/recca0120/code-quest/tailwind-v4"><img src="https://agentmods.dev/badge/skills/recca0120/code-quest/tailwind-v4.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,041 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00102 $0.05041
Opus 5 $0.00051 $0.02521
Sonnet 5 $0.00020 $0.01008
Haiku 4.5 $0.00010 $0.00504

Measured 3d ago against content hash 61505da03ef6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tailwind-v4 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/tailwind-v4/SKILL.md · 435 lines

How it starts

The opening of the file, as written. The whole thing — 435 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tailwind CSS v4

Overview

Tailwind v4 is CSS-first: no tailwind.config.js, no PostCSS config. Everything lives in CSS via directives.

Setup (Vite)

pnpm add tailwindcss @tailwindcss/vite
// vite.config.ts
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({ plugins: [react(), tailwindcss()] })
/* App.css */
@import "tailwindcss";

No content globs needed — auto-detected. No autoprefixer — Lightning CSS handles it.

v3 → v4 Key Changes

v3 v4
tailwind.config.js @theme in CSS
@tailwind base/components/utilities @import "tailwindcss"
darkMode: 'class' @custom-variant dark
content: [...] Auto-detected
PostCSS required @tailwindcss/vite plugin
Container query plugin Built-in @container

Design flow: token-first

設計 UI 時先看 design token,再考慮 utility。不要遇到設計稿的值就寫 arbitrary(text-[13px] / bg-[#3a7] / p-[7px])。

正確順序(寫 JSX 前跑一遍):

  1. 先查既有 token — 需要的顏色 / 字級 / 間距 / radius / shadow / z-index 是否已經在 @theme 或內建 scale?
    • 顏色:grep "^\s*--color-" apps/web/src/App.css
    • Spacing / text / z:用「優先內建 utility」表對照
  2. 差 1–2px / 1–2 階 → 就近取 — design system 的一致性 > pixel-perfect。13pxtext-xstext-sm#3a7d5etext-success
  3. 超出既有 token 範圍 → 先擴 token,不要寫 arbitrary
    • 新色階:加 --color-X@theme
    • 新語意層級(z-index、muted tier、shadow):加對應 --* token
    • 新可重用效果:抽 @utility
  4. 只有這些 arbitrary 值是合法的(見下方「Arbitrary value 正當情境」):
    • calc(...) 計算值
    • 引用動態 CSS variable
    • 刻意 off-grid 且有清楚理由(icon 尺寸、對齊特定視覺錨點)

不要這樣做

// ❌ 為了新設計稿直接寫 arbitrary
<div className="bg-[#2a4a6e] text-[13px] p-[7px] shadow-[0_2px_8px_rgba(0,0,0,0.4)]" />

// ✅ 先把需要的值加進 @theme,再用 semantic utility
// App.css:  --color-surface-sunken: oklch(...); --shadow-card: 0 2px 8px rgba(0,0,0,0.4);
<div className="bg-surface-sunken text-xs p-2 shadow-card" />

特別 callout — literal-pixel arbitraries

任何 \w+-[Npx]text-[13px] / h-[38px] / max-h-[480px] / max-w-[180px] 等)明確禁止

Read the full file on GitHub · 435 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 435 lines · 102 tokens per session scan A 61505da03ef6

Subscribe to this mod's changes

tailwind-v4 is a skill published in the GitHub repository recca0120/code-quest (11 stars, last pushed 2mo ago), licensed MIT. It adds 102 tokens to every session and 5,041 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

design-guide

Paperclip UI design system guide for building consistent, reusable frontend components. Use when creating new UI components, modifying existing ones, adding pages or features to the frontend, styling UI elements, or when you need to understand the design language and conventions. Covers: component creation, design…

paperclipai/paperclip · 105 tokens

Shade ShadCN install

Guardrails for running pnpm dlx shadcn@latest add in Shade — never overwrite existing components, fresh branch first, swap raw colours for semantic tokens after integrating. Trigger when the user proposes a shadcn add, or when a fresh ShadCN-shaped file lands in apps/shade/src/components/ui.

TryGhost/Ghost · 72 tokens

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

material-ui-tailwind

Integrates Material UI with Tailwind CSS v4 using cascade layers (enableCssLayer, @layer order) and documents Tailwind v3 interoperability (preflight, important, injectFirst, portals). Use when combining MUI with Tailwind utilities, slotProps className, or theme token bridges.

mui/material-ui · 67 tokens

author-component

Create or review Blazor components (.razor files) with correct architecture. USE FOR: writing new Blazor components that do NOT involve JavaScript interop, implementing parameters and EventCallback, RenderFragment slots, component lifecycle (OnInitializedAsync, OnParametersSet), async patterns, IAsyncDisposable…

dotnet/skills · 148 tokens

obsidian-layout-adjustment

Workflow for working with the user on changing how Obsidian looks using CSS snippets. Use this whenever the user asks to restyle Obsidian, tune a vault's visual layout, adjust tabs, sidebars, note surfaces, properties, backlinks, graph panes, file explorer rows, icons, links, shadows, active states, or CSS snippets.…

Ar9av/obsidian-wiki · 115 tokens