Loading...
Loading...
TailwindCSS implementation patterns for Refactoring UI principles. COMPANION skill for web-design-mastery. ALWAYS activate for: TailwindCSS, Tailwind classes, utility classes, Tailwind config, Tailwind components, Tailwind dark mode, Tailwind responsive, Tailwind spacing, Tailwind typography, Tailwind colors, Tailwind shadows. Provides class recipes, component patterns, dark mode implementation, responsive patterns. Turkish: Tailwind kullanımı, Tailwind class, utility CSS, Tailwind config. English: Tailwind patterns, utility-first CSS, Tailwind best practices.
npx skill4agent add anilcancakir/my-claude-code tailwindcss-designPrerequisite: This skill provides Tailwind-specific syntax. For design theory and decision-making, referenceskill.web-design-mastery
tailwind.config.jsprimarysecondarybrand// tailwind.config.js
colors: {
primary: { 50: '...', 500: '...', 900: '...' },
secondary: { ... },
brand: { ... }
}primarysecondarybrandaccentzincgrayslate<!-- ✅ CORRECT: Use project colors -->
<button class="bg-primary-600 hover:bg-primary-700 text-white">
<a class="text-primary-600 hover:text-primary-700">
<div class="border-primary-500 bg-primary-50">
<input class="focus:border-primary-500 focus:ring-primary-500">
<!-- Active/selected states -->
<nav class="bg-primary-50 text-primary-700">
<!-- ❌ AVOID when project colors exist -->
<button class="bg-blue-600"> <!-- Generic, ignores brand -->
<button class="bg-zinc-900"> <!-- Only if no primary defined -->| Token | Size | Classes | Use Case |
|---|---|---|---|
| 1 | 4px | | Micro gaps |
| 2 | 8px | | Tight, within components |
| 3 | 12px | | Related elements |
| 4 | 16px | | Standard padding |
| 6 | 24px | | Between sections |
| 8 | 32px | | Major separation |
| 12 | 48px | | Large gaps |
| 16 | 64px | | Hero spacing |
p-4pt-6 pb-2 pl-4 pr-8| Size | Class | Use Case |
|---|---|---|
| 12px | | Labels, meta, fine print |
| 14px | | Body text, default |
| 16px | | Emphasis |
| 18px | | Subheadings |
| 20px | | Card titles |
| 24px | | Page titles |
| 30px | | Hero subheading |
| 36px+ | | Hero heading |
| Role | Class |
|---|---|
| Body | |
| Labels | |
| Headings | |
<!-- Headlines: tighter -->
<h1 class="text-3xl font-semibold tracking-tight">
<!-- All-caps: wider -->
<span class="text-xs font-medium uppercase tracking-wide"><!-- Light mode -->
<span class="text-zinc-900">Primary</span>
<span class="text-zinc-600">Secondary</span>
<span class="text-zinc-400">Muted</span>
<span class="text-zinc-300">Faint</span>
<!-- Dark mode -->
<span class="dark:text-zinc-100">Primary</span>
<span class="dark:text-zinc-400">Secondary</span>
<span class="dark:text-zinc-500">Muted</span>
<span class="dark:text-zinc-600">Faint</span><span class="text-emerald-600 dark:text-emerald-400">Success</span>
<span class="text-amber-600 dark:text-amber-400">Warning</span>
<span class="text-red-600 dark:text-red-400">Error</span>
<span class="text-blue-600 dark:text-blue-400">Info</span>tailwind.config.jsprimarysecondary<button class="bg-primary-600 hover:bg-primary-700">
<a class="text-primary-600 hover:text-primary-700">
<div class="border-primary-500 bg-primary-50"><div class="border border-zinc-200 dark:border-zinc-800"><div class="shadow-sm border border-zinc-200/50"><div class="shadow-sm ring-1 ring-black/5"><div class="bg-zinc-50"> <!-- page -->
<div class="bg-white"> <!-- elevated -->| Level | Class | Use Case |
|---|---|---|
| 1 | | Cards, buttons |
| 2 | | Dropdowns |
| 3 | | Popovers |
| 4 | | Modals |
| 5 | | Full-screen overlays |
<!-- Flat -->
<div class="rounded-lg border border-zinc-200 bg-white p-4 dark:border-zinc-800 dark:bg-zinc-900">
<!-- Elevated -->
<div class="rounded-lg bg-white p-4 shadow-sm ring-1 ring-black/5 dark:bg-zinc-900"><!-- Primary -->
<button class="rounded-md bg-zinc-900 px-3 py-1.5 text-sm font-medium text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200">
<!-- Secondary -->
<button class="rounded-md border border-zinc-300 bg-white px-3 py-1.5 text-sm font-medium text-zinc-700 hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300">
<!-- Ghost -->
<button class="rounded-md px-3 py-1.5 text-sm font-medium text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-100"><input class="w-full rounded-md border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-900 placeholder:text-zinc-400 focus:border-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100" /><!-- Default -->
<a class="flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-100">
<!-- Active -->
<a class="flex items-center gap-2 rounded-md bg-zinc-100 px-3 py-2 text-sm font-medium text-zinc-900 dark:bg-zinc-800 dark:text-zinc-100">| Duration | Class | Use Case |
|---|---|---|
| 150ms | | Hovers, toggles |
| 200ms | | Standard transitions |
| 300ms | | Page transitions |
<div class="transition-all duration-200 ease-out">
<div class="transition-colors duration-150"><div class="animate-fade-in [animation-delay:0ms]">
<div class="animate-fade-in [animation-delay:50ms]">
<div class="animate-fade-in [animation-delay:100ms]"><div class="bg-white dark:bg-zinc-950">
<h1 class="text-zinc-900 dark:text-zinc-100">
<p class="text-zinc-600 dark:text-zinc-400">
<div class="border-zinc-200 dark:border-zinc-800"><!-- ❌ NEVER -->
<div class="shadow-2xl"> <!-- Too dramatic -->
<button class="rounded-2xl px-3"> <!-- Radius too large for size -->
<div class="pt-8 pb-2 pl-6 pr-3"> <!-- Asymmetric without reason -->
<div class="border-4 border-purple-500"> <!-- Thick decorative -->
<div class="animate-bounce"> <!-- Bouncy in enterprise UI -->
<!-- ✅ INSTEAD -->
<div class="shadow-sm">
<button class="rounded-md px-3">
<div class="p-4">
<div class="border border-zinc-200">
<div class="transition-all duration-200">| Topic | File |
|---|---|
| Component depth patterns | depth-strategies.md |
| Complete component library | components.md |
| Responsive patterns | responsive.md |