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 從公開儲存庫中收錄這些內容。

檢舉或申請下架