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
- Check whether the docs snapshot is initialized (
references/docs/ and references/docs-index.json exist).
- If the snapshot is present and fresh, use it as the authoritative source.
- 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.
- Identify the topic (utility, variant, config, migration, compatibility, implementation, refactor, review).
- With a snapshot: find the matching doc in
references/docs-index.json (slug → path) and load only that file from references/docs/.
- For implementation, refactor, or review tasks, also load
references/engineering-playbook.md.
- 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.
1---2name: tailwind-4-docs3description: 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.4---56# Tailwind 4 Docs78## Overview910Use 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.1112When 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.1314The 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.1516## Quick start17181. Check whether the docs snapshot is initialized (`references/docs/` and `references/docs-index.json` exist).192. If the snapshot is present and fresh, use it as the authoritative source.203. If the snapshot is missing or older than one week, do NOT stop — degrade gracefully:21 - 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).22 - 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.23 - 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.244. Identify the topic (utility, variant, config, migration, compatibility, implementation, refactor, review).255. With a snapshot: find the matching doc in `references/docs-index.json` (slug → path) and load only that file from `references/docs/`.266. For implementation, refactor, or review tasks, also load `references/engineering-playbook.md`.277. Apply guidance and call out any breaking changes, deprecations, or constraints.2829## Initialization (recommended, once per install)3031Initializing 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.3233Run the sync script to download the Tailwind docs locally. This requires network access, git, and Python 3:3435```36python skills/tailwind-4-docs/scripts/sync_tailwind_docs.py --accept-docs-license37```3839This 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.4041If 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.4243When 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.4445## References map4647Bundled (always available, snapshot-independent):4849- `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.50- `references/gotchas.md` — quick scan of common v4 migration pitfalls.51- `references/engineering-playbook.md` — agent-oriented implementation, refactor, and review guide.5253Generated by the sync script (present only after initialization):5455- `references/docs/` — the Tailwind v4 MDX docs snapshot.56- `references/docs-index.json` — primary machine-readable index (`slug`, `path`, `title`, `description`), derived from the MDX files and robust to upstream sidebar changes.57- `references/docs-index.tsx` — secondary copy of the upstream sidebar map, when present.58- `references/docs-source.txt` — upstream repo, commit, and snapshot date (or reports that initialization is pending).5960## MDX handling6162- Treat `export const title` and `export const description` as metadata.63- Read JSX callouts like `<TipInfo>` or `<TipBad>` as guidance text.6465## Common entry points6667- Post-4.0 features (no snapshot needed): `references/version-deltas.md`.68- Migration: `references/docs/upgrade-guide.mdx`, `references/docs/compatibility.mdx`.69- Implementation/refactor/review: `references/engineering-playbook.md`.70- Gotchas overview: `references/gotchas.md`.71- Configuration and directives: `references/docs/functions-and-directives.mdx`, `references/docs/adding-custom-styles.mdx`, `references/docs/theme.mdx`.72- Variants and responsive patterns: `references/docs/hover-focus-and-other-states.mdx`, `references/docs/responsive-design.mdx`.73- Core behavior: `references/docs/preflight.mdx`, `references/docs/detecting-classes-in-source-files.mdx`.7475## Migration checklist7677When upgrading from v3 to v4, always confirm the following in the docs:7879- Browser support and compatibility expectations.80- Tooling changes: `@tailwindcss/postcss`, `@tailwindcss/cli`, `@tailwindcss/vite`.81- Import syntax: `@import "tailwindcss"` replaces `@tailwind` directives.82- Utility renames/removals, prefix format, and important modifier placement.83- Changes to variants, transforms, and arbitrary value syntax.8485## Update workflow8687Run `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`.8889---