tailwind-css-patterns
Tailwind CSS のユーティリティ設計とパターン化を支援するスキル。レイアウト・状態・レスポンシブ対応を整理し、再利用可能なUIパターンを構築する。Anchors:• Tailwind CSS Documentation / 適用: ユーティリティ設計 / 目的: 公式ベストプラクティス準拠• Responsive Web Design / 適用: ブレークポイント設計 / 目的: モバイルファーストの整理• Class Variance Authority (CVA) / 適用: バリアント設計 / 目的: 状態と組み合わせの整理Trigger:Use when designing Tailwind UI patterns, reducing utility bloat, or standardizing responsive and state styles.tailwind css, utility classes, responsive design, component patterns, class variance
When & Why to Use This Skill
This Claude skill optimizes Tailwind CSS workflows by providing a systematic approach to utility design and UI patterning. It enables developers to build scalable, reusable UI components while maintaining strict adherence to mobile-first responsive design and official best practices, effectively preventing utility class bloat and ensuring long-term maintainability.
Use Cases
- Standardizing UI patterns: Establish a consistent design system by defining reusable utility combinations and naming conventions across a project.
- Refactoring utility bloat: Analyze and refactor long, repetitive class strings into organized component variants using Class Variance Authority (CVA) principles.
- Mobile-first responsive implementation: Systematically design and implement layouts that scale seamlessly across devices using standardized breakpoints.
- Component state management: Organize complex UI states (hover, focus, active) through a structured variant-based approach to ensure visual and functional consistency.
- Automated CSS auditing: Use built-in scripts to analyze Tailwind usage and identify areas where class length or arbitrary values exceed project standards.
| name | tailwind-css-patterns |
|---|---|
| description | | |
| • Tailwind CSS Documentation / 適用 | ユーティリティ設計 / 目的: 公式ベストプラクティス準拠 |
| • Responsive Web Design / 適用 | ブレークポイント設計 / 目的: モバイルファーストの整理 |
| • Class Variance Authority (CVA) / 適用 | バリアント設計 / 目的: 状態と組み合わせの整理 |
Tailwind CSS Patterns
概要
Tailwind CSS のクラス設計とパターン化を整理し、再利用可能なUIライブラリを構築するスキル。クラス肥大化を抑え、レスポンシブと状態表現を体系化する。
詳細は references/Level1_basics.md から段階的に参照する。
ワークフロー
Phase 1: コンテキスト整理
目的: UIの目的と制約を整理する。
アクション:
- 画面種別と利用シーンを整理する。
- レイアウトと状態表現の要件を確認する。
- 使用するブレークポイント方針を決定する。
Phase 2: パターン設計
目的: パターンライブラリを設計する。
アクション:
assets/pattern-library.mdからパターンを選定する。assets/component-variants-template.tsxを基にバリアントを定義する。- 再利用ルールと命名規則を定める。
Phase 3: 検証
目的: クラス肥大化と一貫性を検証する。
アクション:
scripts/analyze-tailwind.mjsで利用状況を分析する。scripts/check-utility-bloat.mjsでクラス長を検査する。- 改善点をパターンに反映する。
Task仕様ナビ
| Phase | Task | 目的 | 入力 | 出力 |
|---|---|---|---|---|
| 1 | コンテキスト整理 | 画面目的と制約を整理 | ユーザー要求 | コンテキストメモ |
| 2 | パターン設計 | パターンとバリアントを設計 | コンテキストメモ | パターン設計書 |
| 3 | パターン検証 | クラス肥大化と一貫性確認 | UI実装 | 検証レポート |
ベストプラクティス
すべきこと
- 同一用途のUIは同じパターンを使い回す。
- レスポンシブはモバイルファーストで設計する。
- 状態表現はバリアントで整理する。
- 長すぎるクラスはコンポーネント化を検討する。
避けるべきこと
- クラスのコピペによるばらつきを放置しない。
- ブレークポイントの乱用を避ける。
- 任意値の多用を常態化させない。
リソース/スクリプト参照
references/
references/Level1_basics.md: 基礎指針references/Level2_intermediate.md: 実務パターンreferences/Level3_advanced.md: 高度な設計指針references/Level4_expert.md: 専門領域の注意点references/layout-patterns.md: レイアウトパターンreferences/responsive-strategy.md: ブレークポイント設計references/responsive-patterns.md: レスポンシブ実装例references/component-states.md: 状態設計references/cva-guide.md: バリアント設計references/dark-mode-guide.md: ダークモード設計
assets/
assets/pattern-library.md: パターンライブラリassets/component-skeletons.md: コンポーネント骨組みassets/component-variants-template.tsx: バリアントテンプレートassets/tailwind-config-template.js: 設定テンプレート
scripts/
scripts/analyze-tailwind.mjs: Tailwind 使用状況分析scripts/check-utility-bloat.mjs: クラス肥大化検査
変更履歴
| Version | Date | Changes |
|---|---|---|
| 2.0.0 | 2026-01-02 | 18-skills.md 仕様に準拠した構造へ更新 |