tailwind-4-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTailwind 4 Docs
Tailwind 4 文档
Overview
概述
Use this skill to navigate a locally synced Tailwind CSS v4 documentation snapshot and answer development, configuration, and migration questions with official guidance.
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.
使用本技能可访问本地同步的Tailwind CSS v4文档快照,依据官方指南回答开发、配置及迁移相关问题。
该文档快照未与本技能捆绑,因为上游仓库为源码可用但非开源。用户需自行初始化快照,并负责遵守上游许可协议。
Quick start
快速开始
- Check whether the docs snapshot is initialized (and
references/docs/exist).references/docs-index.tsx - If the snapshot is missing or older than one week, stop and ask to run the initialization step in "Initialization" before continuing. Do not answer the user's question until the snapshot is initialized.
- Identify the topic (utility, variant, config, migration, compatibility).
- Find the matching doc in .
references/docs-index.tsx - Load only the relevant file from .
references/docs/ - Apply guidance and call out any breaking changes or constraints.
- 检查文档快照是否已初始化(确认和
references/docs/文件存在)。references/docs-index.tsx - 若快照缺失或已超过一周未更新,请暂停操作,先执行「初始化」章节中的步骤,完成后方可继续。在快照初始化前,请勿回答用户的问题。
- 确定主题(工具类、变体、配置、迁移、兼容性)。
- 在中查找匹配的文档。
references/docs-index.tsx - 仅从加载相关文件。
references/docs/ - 应用指南内容,并标注任何破坏性变更或约束条件。
Initialization (required once per install)
初始化(每次安装需执行一次)
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-licenseThis pulls content from . That repo is source-available and explicitly not open-source, so the user must accept its license before downloading and keep the snapshot local.
tailwindlabs/tailwindcss.comIf you cannot run tools or have no internet access, ask the user to run the exact command above in a terminal, then continue once and exist.
references/docs/references/docs-index.tsxIf the snapshot is missing or older than one week, you must ask for permission to run the command or ask the user to run it. Do not proceed with Tailwind guidance until the snapshot is initialized or refreshed.
If initialization is blocked (no internet or no write access), use as a limited fallback and ask the user to consult the official docs.
references/gotchas.md运行同步脚本以在本地下载Tailwind文档。此操作需要网络连接、git和Python 3环境:
python skills/tailwind-4-docs/scripts/sync_tailwind_docs.py --accept-docs-license该脚本会从拉取内容。该仓库为源码可用,但明确非开源,因此用户在下载前必须接受其许可协议,并将快照保存在本地。
tailwindlabs/tailwindcss.com若无法运行工具或无网络连接,请要求用户在终端中运行上述命令,待和文件存在后再继续。
references/docs/references/docs-index.tsx若快照缺失或已超过一周未更新,必须先请求许可运行该命令,或让用户自行执行。在快照初始化或更新完成前,请勿提供Tailwind相关指导。
若初始化受阻(无网络或无写入权限),可使用作为有限的备选方案,并建议用户查阅官方文档。
references/gotchas.mdReferences map
参考资源映射
- is generated locally and contains the Tailwind v4 MDX docs snapshot.
references/docs/ - is generated locally and contains the category and slug map used by the docs sidebar.
references/docs-index.tsx - captures the upstream repo, commit, and snapshot date (or reports that initialization is pending).
references/docs-source.txt - provides a quick scan of common v4 migration pitfalls.
references/gotchas.md
- :本地生成的目录,包含Tailwind v4 MDX格式的文档快照。
references/docs/ - :本地生成的文件,包含文档侧边栏使用的分类及slug映射。
references/docs-index.tsx - :记录上游仓库、提交记录及快照日期(或提示初始化待处理)。
references/docs-source.txt - :提供v4迁移常见陷阱的快速概览。
references/gotchas.md
MDX handling
MDX处理规则
- Treat and
export const titleas metadata.export const description - Read JSX callouts like or
<TipInfo>as guidance text.<TipBad>
- 将和
export const title视为元数据。export const description - 将或
<TipInfo>等JSX提示组件内容视为指导文本。<TipBad>
Common entry points
常用入口
- Migration: ,
references/docs/upgrade-guide.mdx.references/docs/compatibility.mdx - 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
- 迁移:、
references/docs/upgrade-guide.mdx。references/docs/compatibility.mdx - 注意事项概览:。
references/gotchas.md - 配置与指令:、
references/docs/functions-and-directives.mdx、references/docs/adding-custom-styles.mdx。references/docs/theme.mdx - 变体与响应式模式:、
references/docs/hover-focus-and-other-states.mdx。references/docs/responsive-design.mdx - 核心行为:、
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: replaces
@import "tailwindcss"directives.@tailwind - Utility renames/removals, prefix format, and important modifier placement.
- Changes to variants, transforms, and arbitrary value syntax.
从v3升级至v4时,请务必在文档中确认以下内容:
- 浏览器支持及兼容性要求。
- 工具链变更:、
@tailwindcss/postcss、@tailwindcss/cli。@tailwindcss/vite - 导入语法:替代
@import "tailwindcss"指令。@tailwind - 工具类重命名/移除、前缀格式及!important修饰符的位置。
- 变体、变换及任意值语法的变更。
Update workflow
更新工作流
Run to refresh the snapshot. Use if you already have a local clone of to speed up syncs. Always pass .
scripts/sync_tailwind_docs.py--local-repotailwindlabs/tailwindcss.com--accept-docs-license运行以刷新快照。若已本地克隆仓库,可使用参数加速同步。请始终传入参数。
scripts/sync_tailwind_docs.pytailwindlabs/tailwindcss.com--local-repo--accept-docs-license