skills/react-tailwind/SKILL.md
Opinionated assistant for installing and configuring Tailwind CSS in React projects, then revamping components using Tailwind utility classes and semantic design tokens. Use when working on React (CRA, Vite, Next.js, Remix, plain SPA) and you need guidance on Tailwind setup, dependency selection and installation order, configuration, semantic theme design, and common UI recipes (forms, data tables, navigation, modals, layout).
npx skillsauth add babandeepsingh/skills react-tailwindInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill to turn a React project into a well-structured Tailwind-driven UI, or to refactor an existing Tailwind setup into cleaner, token-based styling and reusable patterns.
You are helping with:
tailwind.config (colors, spacing, typography, radii, shadows)Always assume the user wants practical, copy-pastable steps plus concrete component examples.
Before giving commands or code, detect how the app is built and tailor instructions:
package.json has react-scripts: treat as Create React App.vite appears in devDependencies or scripts: treat as Vite React.next appears: treat as Next.js (App Router if app/ exists, Pages Router otherwise).react-scripts/vite/next are absent: treat as generic React SPA using webpack or similar; provide framework-agnostic guidance.When uncertain, default to Vite-like Tailwind setup and clearly say how to adapt:
tailwind.config.js, postcss.config.js, entry CSS).npm and yarn variants when useful.Follow this sequence whenever setting up Tailwind in a React project:
tailwindcss postcss autoprefixer@headlessui/react, @heroicons/react, Radix, etc.) if the user wants prebuilt patterns.npx tailwindcss init -p).tailwind.config.* and postcss.config.* are created or updated.content paths
./index.html (if Vite)./src/**/*.{js,ts,jsx,tsx}./app/**/*.{js,ts,jsx,tsx,mdx} and/or ./pages/**/*.{js,ts,jsx,tsx} for Next.js.node_modules or build outputs.src/index.css, src/globals.css, app/globals.css) containing:
@tailwind base;@tailwind components;@tailwind utilities;main.tsx, _app.tsx, layout.tsx, etc.).className="text-red-500") and confirm it renders correctly.content pathsWhen installing additional UI libraries (e.g. Tailwind UI, Headless UI, Radix), always:
@floating-ui).Aim to design a semantic theme layer instead of scattering raw brand colors and spacing everywhere.
When editing tailwind.config.*:
theme.colors and theme.extend.colors organized by semantic purpose, not literal brand hex names.// Example shape – adapt values and names to user brand
theme: {
extend: {
colors: {
bg: {
canvas: '#020617',
subtle: '#0b1120',
elevated: '#020617'
},
border: {
subtle: '#1e293b',
strong: '#475569',
focus: '#38bdf8'
},
text: {
primary: '#e5e7eb',
secondary: '#9ca3af',
muted: '#6b7280',
danger: '#fecaca'
},
primary: {
DEFAULT: '#38bdf8',
foreground: '#0f172a',
soft: '#0ea5e9'
},
danger: {
DEFAULT: '#ef4444',
subtle: '#fee2e2'
},
success: {
DEFAULT: '#22c55e',
subtle: '#dcfce7'
}
},
borderRadius: {
sm: '0.375rem',
md: '0.5rem',
lg: '0.75rem',
xl: '1rem'
},
boxShadow: {
soft: '0 1px 2px 0 rgba(15,23,42,0.35)',
raised: '0 10px 30px rgba(15,23,42,0.6)'
}
}
}
Guidelines:
bg.canvas, text.secondary, border.focus) over raw brand names.dark class strategy (darkMode: 'class').dark class on html/body/root using React state or a small theme hook.Whenever you introduce or change tokens, also show one or two component snippets that use them so the user sees concrete usage.
When the user wants to "revamp" or "modernize" components with Tailwind:
flex, grid, gap, space-y-*, max-w-*, overflow-*).Button, Card, Input, Modal).className extension hooks.clsx, cva).Always provide before/after snippets when possible: old JSX/CSS vs. Tailwind-powered JSX.
Use these patterns as starting points and adapt tokens to the user’s theme. Prefer semantic Tailwind tokens (e.g. bg-bg-elevated, text-text-secondary) if available; otherwise fall back to typical defaults.
Goals: consistent spacing, clear label/input alignment, accessible focus styles, helpful error text.
Form pattern:
gap.htmlFor, consistent typography.w-fullWhen refactoring, ensure:
border-danger, text-danger).Goals: readable rows, good density control, clear sorting/selection affordances.
Table pattern:
overflow-x-auto with responsive padding.min-w-full divide-y divide-border-subtle.bg-bg-subtle).text-text-secondary for less visual noise.divide-y divide-border-subtle.hover:bg-bg-subtle/60.bg-primary/5 border-l-2 border-primary.For actions within rows, recommend:
space-x-2) and hit area (p-1.5–p-2).Navigation layout:
flex items-center justify-between h-14 px-4 border-b border-border-subtle bg-bg-elevated.hidden md:flex md:w-64 md:flex-col border-r border-border-subtle bg-bg-subtle.flex-1 overflow-y-auto p-4 md:p-6.Nav items:
flex items-center gap-2 rounded-md px-2.5 py-2 text-sm font-medium.text-text-secondary.bg-bg-elevated text-text-primary.hover:bg-bg-elevated/70 hover:text-text-primary.Prefer grouping navigation into arrays of config objects (label, icon, href, active) and mapping to JSX; this makes it easier to restyle later.
For accessible modals:
@headlessui/react or Radix Dialog) when possible.role="dialog", aria-modal="true").Styling:
fixed inset-0 bg-black/60 backdrop-blur-sm.fixed inset-0 flex items-center justify-center px-4.w-full max-w-lg rounded-lg bg-bg-elevated shadow-raised p-6Buttons inside modals should reuse the app’s primary/secondary button components rather than ad-hoc classes.
When the user asks to "set up Tailwind" or "add Tailwind components", explicitly lay out the order of operations:
Always keep the package.json in sync with your recommendations (devDependencies vs dependencies) and highlight any required Node or React versions when relevant.
When debugging Tailwind + React setups, check for these issues:
content globs not matching file paths or extensions.@tailwind directives not imported anywhere.content paths causing aggressive purging.When you fix or diagnose an issue, give a short checklist the user can re-run next time (e.g. "verify config paths, CSS import, and dev server restart").
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
tools
Opinionated assistant for installing and configuring Tailwind CSS in React projects, then revamping components using Tailwind utility classes and semantic design tokens. Use when working on React (CRA, Vite, Next.js, Remix, plain SPA) and you need guidance on Tailwind setup, dependency selection and installation order, configuration, semantic theme design, and common UI recipes (forms, data tables, navigation, modals, layout).
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.