A guide for using Tailwind CSS utility classes and configuration for UI development.
Install
mkdir -p .claude/skills/tailwind && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10791" && unzip -o skill.zip -d .claude/skills/tailwind && rm skill.zipInstalls to .claude/skills/tailwind
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Apply Tailwind CSS utility-first styling, responsive design, and theming. Use when styling with Tailwind, building UI with utility classes, configuring tailwind.config, or when the user mentions Tailwind.Key capabilities
- →Apply utility classes
- →Configure theme tokens
- →Implement responsive design
How it works
It applies utility-first styling and theme tokens based on Tailwind CSS principles.
Inputs & outputs
When to use tailwind
- →Apply utility classes for layout
- →Configure theme tokens
- →Implement responsive design components
About this skill
Tailwind CSS
When to Use
Apply this skill when writing or refactoring styles with Tailwind CSS: components, pages, layout, responsive behavior, dark mode, or Tailwind config.
Principles
- Utility-first: Prefer utility classes over custom CSS. Compose layout, spacing, typography, and colors from Tailwind classes.
- Design tokens: Use theme values (e.g.
bg-primary,text-sm,rounded-lg) instead of arbitrary values unless the design explicitly requires a one-off value. - Responsive: Use responsive prefixes (
sm:,md:,lg:,xl:,2xl:) for breakpoint-specific styles. Mobile-first: base classes for smallest viewport, then override up. - Extract components sparingly: Prefer keeping utilities in the template. Use
@applyonly for repeated patterns (e.g. a shared button variant) and keep@applylists short.
Common Patterns
Layout
- Flex:
flex,flex-col/flex-row,items-center,justify-between,gap-4,flex-1,flex-wrap. - Grid:
grid,grid-cols-2,grid-cols-3,gap-4,col-span-2,place-items-center. - Spacing:
p-4,px-6,py-2,m-auto,space-x-4/space-y-2(for gaps between siblings).
Typography
- Size:
text-xsthroughtext-5xl,text-base(default). - Weight:
font-normal,font-medium,font-semibold,font-bold. - Color:
text-gray-900,text-white,text-inherit. Prefer semantic tokens if defined in theme. - Line height:
leading-tight,leading-normal,leading-relaxed.
Colors and Backgrounds
- Background:
bg-white,bg-gray-100,bg-transparent. - Borders:
border,border-gray-200,rounded-md,rounded-full. - Opacity:
opacity-50,bg-black/10(arbitrary opacity).
Interactivity and State
- Hover/focus:
hover:bg-gray-100,focus:ring-2,focus:outline-none,focus-visible:ring-2. - Disabled:
disabled:opacity-50,disabled:pointer-events-none. - Transitions:
transition,transition-colors,duration-200.
Dark Mode
- Use
dark:prefix when dark mode is enabled (e.g.dark:bg-gray-800,dark:text-gray-200). - Ensure sufficient contrast and test both modes.
Arbitrary Values
- Use when theme doesn’t cover the value:
w-[137px],top-[calc(100%-2rem)],bg-[#1a1a2e]. - Prefer extending
tailwind.configwith named tokens for repeated values.
Config
- Custom tokens: Add in
theme.extend(e.g.colors,spacing,fontFamily,borderRadius) so they’re available as utilities. - Content paths: Ensure
contentintailwind.configincludes all template/component paths so classes are generated. - Plugins: Use official plugins (e.g.
@tailwindcss/forms,@tailwindcss/typography) when needed; document any custom plugins.
What to Avoid
- Long
@applychains; prefer utilities in markup or small, focused components. - Inline styles for things Tailwind can do (e.g. use
w-4 h-4instead ofstyle={{ width: 16, height: 16 }}when possible). - Mixing unrelated spacing scales; stick to Tailwind’s spacing scale unless the design system defines another.
Example
// Card with responsive layout and hover
<div className="flex flex-col rounded-lg border border-gray-200 bg-white p-4 shadow-sm transition-shadow hover:shadow-md dark:border-gray-700 dark:bg-gray-800">
<h2 className="text-lg font-semibold text-gray-900 dark:text-white">Title</h2>
<p className="mt-2 text-sm text-gray-600 dark:text-gray-300">Description.</p>
<div className="mt-4 flex gap-2">
<button className="rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
Primary
</button>
<button className="rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700">
Secondary
</button>
</div>
</div>
When not to use it
- →Inline styles
- →Mixing spacing scales
Prerequisites
Limitations
- →Requires correct content paths in config
How it compares
It promotes utility-first composition over custom CSS or inline styles.
Compared to similar skills
tailwind side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| tailwind (this skill) | 0 | 5mo | No flags | Beginner |
| ui-styling | 12 | 9mo | Review | Beginner |
| tailwind-design-system | 34 | 2mo | No flags | Intermediate |
| figma | 22 | 4mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by hsc00
View all by hsc00 →You might also like
ui-styling
mrgoonie
Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns, forms, tables), customizing themes and colors, implementing dark mode, generating visual designs and posters, or establishing consistent styling patterns across applications.
tailwind-design-system
wshobson
Build scalable design systems with Tailwind CSS, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.
figma
openai
Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.
design-system-patterns
wshobson
Build scalable design systems with design tokens, theming infrastructure, and component architecture patterns. Use when creating design tokens, implementing theme switching, building component libraries, or establishing design system foundations.
interaction-design
wshobson
Design and implement microinteractions, motion design, transitions, and user feedback patterns. Use when adding polish to UI interactions, implementing loading states, or creating delightful user experiences.
web-design-reviewer
github
This skill enables visual inspection of websites running locally or remotely to identify and fix design issues. Triggers on requests like "review website design", "check the UI", "fix the layout", "find design problems". Detects issues with responsive design, accessibility, visual consistency, and layout breakage, then performs fixes at the source code level.