Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Tailwind Patterns

ASecurity

Build UIs with Tailwind CSS: utility composition, component extraction, theming, dark mode, and responsive design. Use for utility-first styling in any framework.

2 stars
0 votes
0 copies
10 views
Added 9/29/2026
ai-agentsgoreactvue

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill tailwind-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tailwind Patterns?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Tailwind Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-tailwind-patterns/badge)](https://www.skillsdirectory.com/skills/aicodedecode-tailwind-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: tailwind-patterns
description: Build UIs with Tailwind CSS: utility composition, component extraction, theming, dark mode, and responsive design. Use for utility-first styling in any framework.
category: web-development
---

# Tailwind Patterns

A practical guide to Tailwind CSS done professionally: composing utilities, extracting components (the right way), theming with design tokens, dark mode, responsive design, and keeping utility soup maintainable.

## Overview

Tailwind's utility classes move styling into markup, which trades CSS-file archaeology for long class strings. It works brilliantly with **component extraction**: repeated utility combos become components (React/Vue/etc.), not CSS classes. The failure mode is "utility soup" — 40-class divs repeated across files. The fix is always components, not `@apply` (which the Tailwind team itself de-emphasizes).

## When to use

- Utility-first styling in React/Vue/Svelte/HTML projects.
- Design systems built on Tailwind tokens.
- Dark mode and responsive design via variants.
- Cleaning up an inconsistent Tailwind codebase.

## Core concepts

- **Utilities.** `flex`, `px-4`, `text-sm`, `bg-zinc-900` — single-purpose classes. Learn the naming grammar (`{property}-{scale}`) and you can guess most classes.
- **Variants.** `hover:`, `focus:`, `dark:`, `sm:`/`md:`/`lg:`, `disabled:`, `group-hover:`, `data-[state=open]:` — state and context modifiers. Stackable: `dark:hover:bg-zinc-800`.
- **Theme.** `tailwind.config.js` `theme.extend`: colors, fonts, spacing, radii, shadows — your design tokens. v4 uses CSS-first `@theme`. Semantic names (`surface`, `muted`) over literal (`gray-200`).
- **Dark mode.** `dark:` variant with `class` strategy (toggle `.dark` on `<html>`) or `media` (OS preference). Class strategy + a theme store = user toggle.
- **Responsive.** Mobile-first: base classes are mobile, `md:` overrides up. Design small → large.
- **Arbitrary values.** `w-[137px]`, `grid-cols-[1fr_2fr]`, `text-[13px]` — escape hatch for one-offs. Frequent use = missing theme token.
- **Container queries.** `@container` / `@md:` variants for component-level responsiveness (better than page breakpoints for reusable components).

## Practical workflow

**1. Configure tokens once.**
```js
// tailwind.config.js
module.exports = {
  darkMode: 'class',
  content: ['./src/**/*.{ts,tsx}'],
  theme: { extend: {
    colors: { brand: { 50: '...', 500: '#6d28d9', 600: '...', 900: '...' } },
    fontFamily: { sans: ['Inter', 'system-ui', 'sans-serif'] },
  }},
};
```

**2. Component extraction (the pattern).**
```tsx
// NOT: repeating 15 utilities in 20 files
// YES: one Button component
function Button({ variant = 'primary', className = '', ...props }) {
  const base = 'inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-2 disabled:opacity-50';
  const variants = {
    primary: 'bg-brand-600 text-white hover:bg-brand-500',
    secondary: 'bg-zinc-100 text-zinc-900 hover:bg-zinc-200 dark:bg-zinc-800 dark:text-zinc-100',
  };
  return <button className={`${base} ${variants[variant]} ${className}`} {...props} />;
}
```

**3. Responsive + dark.**
```html
<div class="grid grid-cols-1 gap-4 p-4 md:grid-cols-3 md:p-8 bg-white dark:bg-zinc-950 text-zinc-900 dark:text-zinc-100">
```

**4. Consistency tooling.** Prettier plugin (`prettier-plugin-tailwindcss`) sorts classes deterministically — kills diff noise. Lint against raw color values drifting outside the theme.

## Common pitfalls

- **`@apply` for components.** Extract to framework components instead. `@apply` recreates the CSS-file problems Tailwind avoids and breaks with some variants.
- **Utility soup duplication.** Same 20 classes pasted in 15 files = a missing component. Extract at the third repetition.
- **Literal colors everywhere.** `bg-[#6d28d9]` scattered = theme drift. Put it in the config as `brand-600`.
- **Dark mode afterthought.** Bolting `dark:` on at the end doubles the work. Design both modes from the start; use semantic tokens.
- **Desktop-first responsive.** Writing `lg:` overrides for desktop then fighting mobile. Mobile-first: base = mobile.
- **Overriding with `!important`.** `!`-prefixed utilities signal specificity fights — usually a sign the component structure needs fixing.
- **Purge/content misconfiguration.** Dynamic class construction (`bg-${color}-500`) gets purged in production. Safelist or use full class names in a lookup map.
- **Ignoring the prettier plugin.** Unsorted classes = noisy diffs and review friction. One plugin, zero debate.
- **Huge HTML payloads.** Extremely long class strings bloat HTML; component extraction + gzip mitigates. For truly massive pages, consider whether utilities-per-element is the right call.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698431 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →