返回 Skill 列表
extension
分类: 开发与工程无需 API Key

tailwind

Tailwind CSS v4性能优化和最佳实践指南(以前称为tailwindcss-v4-style)。在编写、审查或重构Tailwind CSS v4代码时应使用此技能,以确保构建性能最优、CSS输出最小化以及v4特性的正确使用。当任务涉及Tailwind配置、@theme指令、实用类、响应式设计、暗模式、容器查询或CSS生成优化时触发。

person作者: jakexiaohubgithub

Tailwind Labs Tailwind CSS v4 Best Practices

Comprehensive performance optimization guide for Tailwind CSS v4 applications, maintained by Tailwind Labs. Contains 42 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Configuring Tailwind CSS v4 build tooling (Vite plugin, PostCSS, CLI)
  • Writing or migrating styles using v4's CSS-first approach
  • Optimizing CSS bundle size and build performance
  • Implementing responsive designs with breakpoints or container queries
  • Setting up theming with @theme directive and design tokens

Rule Categories by Priority

| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Build Configuration | CRITICAL | build- | | 2 | CSS Generation | CRITICAL | gen- | | 3 | Bundle Optimization | HIGH | bundle- | | 4 | Utility Patterns | HIGH | util- | | 5 | Component Architecture | MEDIUM-HIGH | comp- | | 6 | Theming & Design Tokens | MEDIUM | theme- | | 7 | Responsive & Adaptive | MEDIUM | resp- | | 8 | Animation & Transitions | LOW-MEDIUM | anim- |

Quick Reference

1. Build Configuration (CRITICAL)

2. CSS Generation (CRITICAL)

3. Bundle Optimization (HIGH)

4. Utility Patterns (HIGH)

5. Component Architecture (MEDIUM-HIGH)

6. Theming & Design Tokens (MEDIUM)

7. Responsive & Adaptive (MEDIUM)

8. Animation & Transitions (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Full Compiled Document

For a complete guide with all rules expanded, see AGENTS.md.

Reference Files

| File | Description | |------|-------------| | AGENTS.md | Complete compiled guide with all rules | | references/_sections.md | Category definitions and ordering | | assets/templates/_template.md | Template for new rules | | metadata.json | Version and reference information |