# Tailwind 4 Docs

> Comprehensive Tailwind CSS v4 (through v4.3) documentation snapshot, version-delta knowledge, and engineering workflow. Use this skill whenever the user writes, reviews, refactors, configures, or migrates Tailwind CSS — including selecting utilities/variants, CSS-first theme/token setup, v3-to-v4 migration, or any task touching scrollbar/mask/text-shadow/logical-property/@variant features. Works from a local docs snapshot when available and degrades to bundled summaries (version deltas, gotchas, engineering playbook) when not.

- Skill: `wemwi/tailwind-4-docs` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds@latest add wemwi/tailwind-4-docs`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wemwi/tailwind-4-docs/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: wemwi (https://skillmd.com/u/wemwi)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/wemwi/tailwind-4-docs

---


# Tailwind 4 Docs

## Overview

Use this skill to navigate a locally synced Tailwind CSS v4 documentation snapshot and answer development, configuration, migration, implementation, refactor, and review questions with official guidance.

When the snapshot is available it is the authoritative source. When it is not, the skill still works from bundled, snapshot-independent summaries (post-4.0 version deltas, gotchas, and the engineering playbook) — it does not refuse to help.

The docs snapshot is not bundled with this skill because the upstream repository is source-available but not open-source. Users must initialize the snapshot themselves and are responsible for complying with the upstream license.

## Quick start

1. Check whether the docs snapshot is initialized (`references/docs/` and `references/docs-index.json` exist).
2. If the snapshot is present and fresh, use it as the authoritative source.
3. If the snapshot is missing or older than one week, do NOT stop — degrade gracefully:
   - Answer from the snapshot-independent core: `references/version-deltas.md` (post-4.0 features), `references/gotchas.md` (v4 pitfalls), and `references/engineering-playbook.md` (architecture).
   - Tell the user the snapshot is missing/stale and that the answer is based on summarized knowledge, then offer to initialize/refresh it (see "Initialization") for authoritative, version-exact detail.
   - Prefer to initialize *first* (rather than degrade) when the task hinges on exact current syntax/signatures, touches a fast-moving area, or when correctness clearly matters more than speed.
4. Identify the topic (utility, variant, config, migration, compatibility, implementation, refactor, review).
5. With a snapshot: find the matching doc in `references/docs-index.json` (slug → path) and load only that file from `references/docs/`.
6. For implementation, refactor, or review tasks, also load `references/engineering-playbook.md`.
7. Apply guidance and call out any breaking changes, deprecations, or constraints.

## Initialization (recommended, once per install)

Initializing the local docs snapshot gives authoritative, version-exact answers. It is recommended but **not a hard prerequisite** — without it, the skill degrades to its snapshot-independent core (see Quick start step 3) rather than refusing to help.

Run the sync script to download the Tailwind docs locally. This requires network access, git, and Python 3:

```
python skills/tailwind-4-docs/scripts/sync_tailwind_docs.py --accept-docs-license
```

This pulls content from `tailwindlabs/tailwindcss.com`. That repo is source-available and explicitly not open-source, so the user must accept its license before downloading and keep the snapshot local.

If you cannot run tools or have no internet access, either ask the user to run the exact command above in a terminal, or proceed with the degraded fallback and note the limitation. Once `references/docs/` and `references/docs-index.json` exist, switch to the snapshot as the authoritative source.

When the snapshot is missing or older than one week: prefer to refresh it for tasks that need exact current detail; otherwise it is fine to answer from the fallback and offer to refresh. Do not block the user.

## References map

Bundled (always available, snapshot-independent):

- `references/version-deltas.md` — features shipped after v4.0 (v4.1–v4.3), summarized. The primary fallback so guidance does not regress to early-v4 assumptions.
- `references/gotchas.md` — quick scan of common v4 migration pitfalls.
- `references/engineering-playbook.md` — agent-oriented implementation, refactor, and review guide.

Generated by the sync script (present only after initialization):

- `references/docs/` — the Tailwind v4 MDX docs snapshot.
- `references/docs-index.json` — primary machine-readable index (`slug`, `path`, `title`, `description`), derived from the MDX files and robust to upstream sidebar changes.
- `references/docs-index.tsx` — secondary copy of the upstream sidebar map, when present.
- `references/docs-source.txt` — upstream repo, commit, and snapshot date (or reports that initialization is pending).

## MDX handling

- Treat `export const title` and `export const description` as metadata.
- Read JSX callouts like `<TipInfo>` or `<TipBad>` as guidance text.

## Common entry points

- Post-4.0 features (no snapshot needed): `references/version-deltas.md`.
- Migration: `references/docs/upgrade-guide.mdx`, `references/docs/compatibility.mdx`.
- Implementation/refactor/review: `references/engineering-playbook.md`.
- Gotchas overview: `references/gotchas.md`.
- Configuration and directives: `references/docs/functions-and-directives.mdx`, `references/docs/adding-custom-styles.mdx`, `references/docs/theme.mdx`.
- Variants and responsive patterns: `references/docs/hover-focus-and-other-states.mdx`, `references/docs/responsive-design.mdx`.
- Core behavior: `references/docs/preflight.mdx`, `references/docs/detecting-classes-in-source-files.mdx`.

## Migration checklist

When upgrading from v3 to v4, always confirm the following in the docs:

- Browser support and compatibility expectations.
- Tooling changes: `@tailwindcss/postcss`, `@tailwindcss/cli`, `@tailwindcss/vite`.
- Import syntax: `@import "tailwindcss"` replaces `@tailwind` directives.
- Utility renames/removals, prefix format, and important modifier placement.
- Changes to variants, transforms, and arbitrary value syntax.

## Update workflow

Run `scripts/sync_tailwind_docs.py` to refresh the snapshot. Use `--local-repo` if you already have a local clone of `tailwindlabs/tailwindcss.com` to speed up syncs. Always pass `--accept-docs-license`.

---

