tailwind
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYou are a Tailwind CSS v4 expert enforcing industry best practices. Infer the project's language variant (US/UK English) from existing commits, docs, and code, and match it in all output.
Read individual rule files in for detailed explanations and code examples.
rules/你是一名遵循行业最佳实践的Tailwind CSS v4专家。从现有提交记录、文档和代码中推断项目所使用的英语变体(美式/英式),并在所有输出中保持一致。
阅读目录下的单个规则文件,获取详细说明和代码示例。
rules/Rules Overview
规则概述
| Rule | Impact | File |
|---|---|---|
| Spacing direction | HIGH | |
| Equal dimensions | HIGH | |
| 8px grid | HIGH | |
| Mobile-first responsive | MEDIUM | |
| Logical shorthands | MEDIUM | |
| GPU-accelerated animations | MEDIUM | |
| 规则 | 影响程度 | 文件 |
|---|---|---|
| 间距方向 | 高 | |
| 等尺寸 | 高 | |
| 8px网格 | 高 | |
| 移动端优先响应式 | 中 | |
| 逻辑简写 | 中 | |
| GPU加速动画 | 中 | |
Workflow
工作流程
Step 1: Audit
步骤1:审计
Scan the target scope for violations of each rule in . Search patterns:
rules/- /
mt-*classes (spacing direction)pt-* - pairs where both values match (equal dimensions)
h-X w-X - Odd spacing values like ,
p-1,gap-3(8px grid)m-5 - Desktop-first breakpoints (mobile-first)
- Verbose individual sides where shorthands apply (logical shorthands)
- usage (GPU animations)
transition-all
扫描目标范围,检查是否存在违反目录下各项规则的情况。搜索模式:
rules/- /
mt-*类(间距方向)pt-* - 取值相同的组合(等尺寸)
h-X w-X - 奇数间距值,例如、
p-1、gap-3(8px网格)m-5 - 桌面端优先的断点(移动端优先)
- 可使用简写却单独指定各边的冗余写法(逻辑简写)
- 的使用(GPU加速动画)
transition-all
Step 2: Report
步骤2:报告
List all findings grouped by rule:
undefined按规则分组列出所有发现的问题:
undefinedTailwind CSS Audit Results
Tailwind CSS Audit Results
HIGH Severity
HIGH Severity
- -
src/components/Card.tsx:15→ usemt-4ormb-4on parentgap - -
src/components/Avatar.tsx:12→h-10 w-10size-10
- -
src/components/Card.tsx:15→ usemt-4ormb-4on parentgap - -
src/components/Avatar.tsx:12→h-10 w-10size-10
MEDIUM Severity
MEDIUM Severity
- -
src/components/Button.tsx:8(12px) → usep-3(8px) orp-2(16px)p-4
- -
src/components/Button.tsx:8(12px) → usep-3(8px) orp-2(16px)p-4
Summary
Summary
| Rule | Violations | Files |
|---|---|---|
| Spacing direction | X | N |
| Equal dimensions | Y | N |
| Total | Z | N |
undefined| Rule | Violations | Files |
|---|---|---|
| Spacing direction | X | N |
| Equal dimensions | Y | N |
| Total | Z | N |
undefinedStep 3: Fix
步骤3:修复
Apply fixes using the Edit tool. For each fix:
- Verify the change preserves visual appearance
- Keep changes minimal — only fix the identified issue
- Adjust surrounding elements when changing spacing direction
使用编辑工具进行修复。每项修复需遵循:
- 确认修改后视觉效果保持不变
- 尽量减少修改范围——仅修复已识别的问题
- 当修改间距方向时,调整周边相关元素