tailwindcss
できること
このスキルは、ユーティリティファーストのスタイリングツールであるTailwind CSSの使い方を案内します。カスタムCSSを多く書かずに、一貫した間隔と文字組みが欲しいインターフェース開発者向けです。
使う場面
- ✓ユーティリティクラスで、速く一貫したスタイルのWebインターフェースを作っているとき。
- ✓Tailwindのプロジェクトで、レスポンシブなレイアウト、ホバーの状態、ダークモードが必要なとき。
- ✓本番でTailwindのクラスが効かず、原因を探す必要があるとき。
スキルのリンク
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/tailwindcss/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このログインフォームを、スマートフォンできれいに見え、ダークモードにも対応するように、Tailwindでスタイルを整えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、レスポンシブの接頭辞、状態のバリアント、ダークモードの設定を使い、ユーティリティクラスをマークアップに直接加えます。繰り返されるパターンは、小さな再利用可能なスタイルルールの前に、コンポーネントにまとめるよう勧めます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Tailwind CSS — Utility-first Styling Skill
When to use
- Rapid UI building with consistent spacing/typography scales
- Design systems where composition beats bespoke CSS
- Component-driven apps (React/Vue/Svelte), marketing pages, prototypes → production
Key concepts & patterns
- Utilities compose in HTML/JSX:
class="flex gap-4 p-6 bg-zinc-950 text-white" - Responsive variants:
sm: md: lg: xl:etc. - State variants:
hover:,focus:,active:,disabled:,group-hover:,peer-checked: - Arbitrary values (use sparingly):
w-[42rem],bg-[#0b1220],translate-y-[3px] - Dark mode patterns:
dark:with class-based strategy - Extracting repeated patterns:
- Prefer components (JSX/Vue components) first
- Then
@applyfor small reusable patterns (avoid overuse)
- Build pipeline:
- Tailwind scans “content” files for class names and generates CSS (zero-runtime)
Common pitfalls
- Classes not generated in production
- Ensure content paths include all templates/components.
- Avoid building class names dynamically (e.g.
"text-" + color) unless safelisted.
- Overusing
@applyand losing the utility-first benefits - Conflicting styles due to class order assumptions
- Huge HTML class lists with no structure
- Use component composition; break into subcomponents; use
clsx/cvawhen needed.
- Use component composition; break into subcomponents; use
Quick recipes
1) A clean CTA button
<button class="inline-flex items-center justify-center rounded-xl px-5 py-3
bg-indigo-600 text-white font-medium
hover:bg-indigo-500 active:bg-indigo-700
focus:outline-none focus:ring-2 focus:ring-indigo-400/60">
Get started
</button>
2) Responsive hero layout
<section class="mx-auto max-w-6xl px-6 py-16">
<div class="grid gap-10 lg:grid-cols-2 lg:items-center">
<div>
<h1 class="text-4xl font-semibold tracking-tight sm:text-5xl">
Ship a beautiful site fast.
</h1>
<p class="mt-4 text-zinc-600">
Tailwind helps you move quickly without fighting CSS.
</p>
</div>
<div class="rounded-2xl border border-zinc-200 bg-white p-6 shadow-sm">
<!-- media -->
</div>
</div>
</section>
3) Handling dynamic classnames safely
Prefer mapping:
const toneClass = {
success: "bg-emerald-600",
danger: "bg-rose-600",
info: "bg-sky-600",
}[tone];
What to ask the user
- Framework/build tool (Next/Vite/Remix/Webflow export)?
- Do we need a design system (tokens, component library) or a one-off page?
- Dark mode? RTL? accessibility constraints?
よくある質問
一部のTailwindのスタイルが消えるのはなぜですか?
ビルドがすべてのテンプレートファイルをスキャンする必要があり、クラス名は、セーフリストに入れない限り動的に組み立てないよう、スキルは述べています。
@applyを多用すべきですか?
いいえ。ユーティリティクラスの利点が失われるので、多用しないようスキルは警告しています。
ダークモードも扱いますか?
はい。クラスベースのダークモードの方式を扱います。
詳細
作者による元の説明
Use when designing/implementing UI with Tailwind CSS (layout, typography, responsive, theming, component patterns). Includes quick recipes and conventions for clean, consistent web design.
repo: MengTo/Skills
人気
- GitHubのスター
- 7.2k
- ランキング
- #13471
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
3d-cloth-material
7.2kThree.js で、糸の織り、柔らかい光沢、自然な襞、裾、縫い目を持つ、本物の織物らしい布を作るようエージェントを支援します。
3d-falling-leaves
7.2k3D のシーンに、回転し、風に流され、カメラの動きに合わせて再利用される、本物らしい落ち葉を加えるようエージェントを支援します。
3d-four-seasons
7.2k3D のシーンに、春、夏、秋、冬の見た目を加え、シーン全体を作り直さずに、茂み、光、空、雪を変えるようエージェントを支援します。
3d-high-poly-models
7.2k滑らかな形と自然な縁をもつ、詳細な3Dモデルを作り、その後、Web で快適に動く軽いバージョンを準備するようエージェントを支援します。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。