本文へスキップ
Skillpedia
ブランディング48k · #5922

tailwind-patterns

できること

このツールは、Tailwind CSSの最新機能の設定と利用をサポートします。たとえば、CSSで直接スタイルを書く方法、個々のコンポーネントに対して小さい画面サイズの指定を使う方法、モダンなレイアウトの作成などです。

使う場面

  • ✓Tailwind CSSのバージョン4を設定するとき。
  • ✓色、余白、フォントを整理して定義したいとき。
  • ✓ページ全体または特定の部分の大きさに応じて変化するデザインを作るとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tailwind-patterns/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tailwind-patterns/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“新しいトークンシステムを使って、プライマリカラーとセカンダリカラーを設定するにはどうすればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

CSSファイル内で「@theme」ディレクティブを使うと、スタイルを直接定義できます。これにより、色、フォント、余白をより効率的に整理でき、「コンテナクエリ」のような新機能でコンポーネントを適応させることもできます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Tailwind CSS Patterns (v4 - 2025)

Modern utility-first CSS with CSS-native configuration.

When to Use

Use this skill when configuring Tailwind v4, using CSS-first theme and design tokens, or implementing container queries and modern Tailwind patterns.


1. Tailwind v4 Architecture

What Changed from v3

v3 (Legacy) v4 (Current)
tailwind.config.js CSS-based @theme directive
PostCSS plugin Oxide engine (10x faster)
JIT mode Native, always-on
Plugin system CSS-native features
@apply directive Still works, discouraged

v4 Core Concepts

Concept Description
CSS-first Configuration in CSS, not JavaScript
Oxide Engine Rust-based compiler, much faster
Native Nesting CSS nesting without PostCSS
CSS Variables All tokens exposed as --* vars

2. CSS-Based Configuration

Theme Definition

@theme {
  /* Colors - use semantic names */
  --color-primary: oklch(0.7 0.15 250);
  --color-surface: oklch(0.98 0 0);
  --color-surface-dark: oklch(0.15 0 0);
  
  /* Spacing scale */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  
  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

When to Extend vs Override

Action Use When
Extend Adding new values alongside defaults
Override Replacing default scale entirely
Semantic tokens Project-specific naming (primary, surface)

3. Container Queries (v4 Native)

Breakpoint vs Container

Type Responds To
Breakpoint (md:) Viewport width
Container (@container) Parent element width

Container Query Usage

Pattern Classes
Define container @container on parent
Container breakpoint @sm:, @md:, @lg: on children
Named containers @container/card for specificity

When to Use

Scenario Use
Page-level layouts Viewport breakpoints
Component-level responsive Container queries
Reusable components Container queries (context-independent)

4. Responsive Design

Breakpoint System

Prefix Min Width Target
(none) 0px Mobile-first base
sm: 640px Large phone / small tablet
md: 768px Tablet
lg: 1024px Laptop
xl: 1280px Desktop
2xl: 1536px Large desktop

Mobile-First Principle

  1. Write mobile styles first (no prefix)
  2. Add larger screen overrides with prefixes
  3. Example: w-full md:w-1/2 lg:w-1/3

5. Dark Mode

Configuration Strategies

Method Behavior Use When
class .dark class toggles Manual theme switcher
media Follows system preference No user control
selector Custom selector (v4) Complex theming

Dark Mode Pattern

Element Light Dark
Background bg-white dark:bg-zinc-900
Text text-zinc-900 dark:text-zinc-100
Borders border-zinc-200 dark:border-zinc-700

6. Modern Layout Patterns

Flexbox Patterns

Pattern Classes
Center (both axes) flex items-center justify-center
Vertical stack flex flex-col gap-4
Horizontal row flex gap-4
Space between flex justify-between items-center
Wrap grid flex flex-wrap gap-4

Grid Patterns

Pattern Classes
Auto-fit responsive grid grid-cols-[repeat(auto-fit,minmax(250px,1fr))]
Asymmetric (Bento) grid grid-cols-3 grid-rows-2 with spans
Sidebar layout grid grid-cols-[auto_1fr]

Note: Prefer asymmetric/Bento layouts over symmetric 3-column grids.


7. Modern Color System

OKLCH vs RGB/HSL

Format Advantage
OKLCH Perceptually uniform, better for design
HSL Intuitive hue/saturation
RGB Legacy compatibility

Color Token Architecture

Layer Example Purpose
Primitive --blue-500 Raw color values
Semantic --color-primary Purpose-based naming
Component --button-bg Component-specific

8. Typography System

…

よくある質問

「ブレークポイント」と「コンテナクエリ」の違いは何ですか?

ブレークポイントは画面全体のサイズを基準にしますが、コンテナクエリは親要素のサイズを基準にします。これにより、コンポーネントはページ全体のサイズとは無関係に適応できます。

OSがダークモードのとき、サイトを自動でダークにするにはどうすればよいですか?

Tailwindの設定で「media」ストラテジーを使うと、システムの設定に従ってダークモードを適用できます。

「デザイントークン」とは何ですか?

色や余白などのデザインの値を表す変数のことです。見た目の統一感を保ち、プロジェクト全体のスタイルを簡単に更新できるようにします。

詳細

作者による元の説明

Tailwind CSS v4 principles. CSS-first configuration, container queries, modern patterns, design token architecture.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5922
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル