Tailwind

pproenca/dot-skills/skills/.curated/tailwind

作者 pproencacf93c57cac89无许可证215 个星标收录于 2026年10月8日更新于 2026年10月8日仓库7周前更新

Tailwind CSS v4 performance optimization and best practices guidelines (formerly tailwindcss-v4-style). This skill should be used when writing, reviewing, or refactoring Tailwind CSS v4 code to ensure optimal build performance, minimal CSS output, and correct usage of v4 features. Triggers on tasks involving Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.

AI 生成的概览

用于编写、审查和优化 Tailwind CSS v4 代码的指南,涵盖构建配置、主题、工具类与响应式设计。

功能
该技能提供一套结构化的 Tailwind CSS v4 最佳实践规则,共 44 条,按八个优先级类别组织,涵盖构建配置、CSS 生成、打包优化、工具类模式、组件架构、主题与设计令牌、响应式设计以及动画。每条规则都有独立的参考文件,包含说明和代码示例,另有一份汇总文档收录全部规则。它作为编写、审查或重构 Tailwind CSS v4 样式时的指导,而不是可执行工具。
适用场景
适用于配置 Tailwind CSS v4 构建工具(如 Vite 插件、PostCSS 或 CLI)时。也适合编写或迁移到 v4 的 CSS 优先写法、优化 CSS 打包体积与构建性能,以及使用 @theme 指令设置响应式设计、深色模式或主题。
运行要求
不需要脚本或软件包,该技能仅包含说明与参考文档。应用其中的建议需要项目使用 Tailwind CSS v4 和 Node.js 20+ 工具链,但阅读本身无需安装任何内容。

Community Tailwind CSS v4 Best Practices

Comprehensive performance optimization guide for Tailwind CSS v4 applications. Contains 44 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

PriorityCategoryImpactPrefix
1Build ConfigurationCRITICALbuild-
2CSS GenerationCRITICALgen-
3Bundle OptimizationHIGHbundle-
4Utility PatternsHIGHutil-
5Component ArchitectureMEDIUM-HIGHcomp-
6Theming & Design TokensMEDIUMtheme-
7Responsive & AdaptiveMEDIUMresp-
8Animation & TransitionsLOW-MEDIUManim-

Quick Reference

1. Build Configuration (CRITICAL)

  • build-vite-plugin [blocked] - Use Vite Plugin Over PostCSS
  • build-css-import [blocked] - Use CSS Import Over @tailwind Directives
  • build-content-detection [blocked] - Leverage Automatic Content Detection
  • build-node-version [blocked] - Use Node.js 20+ for Optimal Performance
  • build-postcss-simplify [blocked] - Remove Redundant PostCSS Plugins
  • build-cli-package [blocked] - Use Correct CLI Package

2. CSS Generation (CRITICAL)

  • gen-css-first-config [blocked] - Use CSS-First Configuration Over JavaScript
  • gen-avoid-theme-bloat [blocked] - Avoid Excessive Theme Variables
  • gen-oklch-colors [blocked] - Use OKLCH Color Space for Vivid Colors
  • gen-utility-directive [blocked] - Use @utility for Custom Utilities
  • gen-dynamic-utilities [blocked] - Use Dynamic Utility Values
  • gen-css-variable-syntax [blocked] - Use Parentheses for CSS Variable References

3. Bundle Optimization (HIGH)

  • bundle-remove-unused-plugins [blocked] - Remove Built-in Plugins
  • bundle-avoid-preprocessors [blocked] - Avoid Sass/Less Preprocessors
  • bundle-css-minification [blocked] - Enable CSS Minification in Production
  • bundle-avoid-cdn-production [blocked] - Avoid Play CDN in Production
  • bundle-split-critical-css [blocked] - Extract Critical CSS for Initial Render

4. Utility Patterns (HIGH)

  • util-renamed-utilities [blocked] - Use Renamed Utility Classes
  • util-important-modifier [blocked] - Use Trailing Important Modifier
  • util-variant-stacking [blocked] - Use Left-to-Right Variant Stacking
  • util-explicit-colors [blocked] - Use Explicit Border and Ring Colors
  • util-opacity-modifier [blocked] - Use Slash Opacity Modifier
  • util-gradient-via-none [blocked] - Use via-none to Reset Gradient Stops

5. Component Architecture (MEDIUM-HIGH)

  • comp-avoid-apply-overuse [blocked] - Avoid Overusing @apply
  • comp-reference-directive [blocked] - Use @reference for CSS Module Integration
  • comp-utility-file-scope [blocked] - Understand Utility File Scope
  • comp-smart-sorting [blocked] - Leverage Smart Utility Sorting
  • comp-container-customize [blocked] - Customize Container with @utility
  • comp-custom-variant [blocked] - Use @custom-variant for Custom Variant Definitions

6. Theming & Design Tokens (MEDIUM)

  • theme-semantic-tokens [blocked] - Use Semantic Design Token Names
  • theme-dark-mode-class [blocked] - Use Class-Based Dark Mode for Control
  • theme-prefix-variables [blocked] - Use Prefix for Variable Namespacing
  • theme-runtime-variables [blocked] - Leverage Runtime CSS Variables
  • theme-color-scheme [blocked] - Set color-scheme for Native Dark Mode
  • theme-inline-static [blocked] - Use @theme inline and @theme static for Variable Control

7. Responsive & Adaptive (MEDIUM)

  • resp-mobile-first [blocked] - Use Mobile-First Responsive Design
  • resp-container-queries [blocked] - Use Container Queries for Component-Level Responsiveness
  • resp-custom-breakpoints [blocked] - Define Custom Breakpoints in @theme
  • resp-hover-capability [blocked] - Pair Hover with Active for Touch-Friendly Interactions
  • resp-logical-properties [blocked] - Use Logical Properties for RTL Support

8. Animation & Transitions (LOW-MEDIUM)

  • anim-gpu-accelerated [blocked] - Use GPU-Accelerated Transform Properties
  • anim-starting-style [blocked] - Use @starting-style for Entry Animations
  • anim-gradient-interpolation [blocked] - Use OKLCH Gradient Interpolation
  • anim-3d-transforms [blocked] - Use Built-in 3D Transform Utilities

How to Use

Read individual reference files for detailed explanations and code examples:

  • Section definitions [blocked] - Category structure and impact levels
  • Rule template [blocked] - Template for adding new rules

Full Compiled Document

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

Reference Files

FileDescription
AGENTS.md [blocked]Complete compiled guide with all rules
references/_sections.md [blocked]Category definitions and ordering
assets/templates/_template.md [blocked]Template for new rules
metadata.json [blocked]Version and reference information

来源与署名

来源:pproenca/dot-skills位于skills/.curated/tailwind提交cf93c57

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架