tailwindcss · mengto — Claude Code skill: Tailwind CSS UI work
A skill that steers your coding agent through Tailwind CSS UI work: layout, typography, responsive variants, theming and component patterns.
npx skills add MengTo/Skills --skill tailwindcss -a claude-codeWhat tailwindcss does
The skill kicks in when the agent designs or implements UI with Tailwind CSS. It carries conventions and quick recipes: composing utilities in markup, responsive variants sm: through xl:, state variants like hover:, focus:, group-hover:, and class-based dark mode with dark:. Two worked examples ship with it — a CTA button and a responsive hero section.
A pitfalls section covers the usual breakage. Classes go missing from production builds when the content paths skip templates or components, or when a class name is built by concatenation such as "text-" + color. The skill pushes repeated patterns into components first and treats @apply as a small-pattern tool. Dynamic class names get a lookup map instead of string glue.
Before touching code, the skill asks about your framework and build tool, whether you want a design system with tokens or a single page, and what constraints exist around dark mode, RTL and accessibility. Answer those up front. Otherwise the agent guesses at your project structure and the output drifts.
What it helps with
- build a responsive hero without hand-written CSS
- pull repeated class strings into a component
- debug classes missing from a production build
- add dark mode with the
dark:variant - replace concatenated class names with a lookup map
Example prompts for the agent
- Build a product card with Tailwind CSS and a dark variant
- Make a mobile-first responsive pricing grid
- Why are my Tailwind classes missing from the production build?
How to install tailwindcss
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tailwindcss -a claude-code2Manually: put the files in place
~/.claude/skills/tailwindcss/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tailwindcss/
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tailwindcss -a codex2Manually: put the files in place
.agents/skills/tailwindcss/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tailwindcss -a cursor2Manually: put the files in place
.cursor/skills/tailwindcss/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install MengTo/Skills tailwindcss2Manually: put the files in place
.github/skills/tailwindcss/SKILL.md1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tailwindcss -a gemini-cli2Platform CLI
gemini skills install https://github.com/MengTo/Skills --path agent-skills/web-design/tailwindcssManually: put the files in place
.devin/skills/tailwindcss/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tailwindcss -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about tailwindcss
How do I install tailwindcss in Claude?
Run npx skills add MengTo/Skills --skill tailwindcss -a claude-code, then check ~/.claude/skills/tailwindcss/SKILL.md.
What does the tailwindcss skill do?
It gives the agent conventions and recipes for Tailwind CSS work: utilities, responsive and state variants, dark mode, and how to handle repeated patterns.
Why do Tailwind classes disappear in production?
The skill names two causes: content paths that miss templates or components, and class names assembled dynamically like "text-" + color. A lookup map or safelist fixes the second.
Source text
SKILL.md · MIT
---
name: tailwindcss
description: Use when designing/implementing UI with Tailwind CSS (layout, typography, responsive, theming, component patterns). Includes quick recipes and conventions for clean, consistent web design.
---
# 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 `@apply` for 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 `@apply` and 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/cva` when needed.
## Quick recipes
### 1) A clean CTA button
```html
<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
```html
<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:
```js
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?
© MengTo · MIT · MengTo/Skills
Similar skills
Everything for Frontend and UI →tailwindcss by other authors comes first.