[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B36T14263T8JE8SVJC64FM":3,"skill-same:01M7B36T14263T8JE8SVJC64FM":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7B36T14263T8JE8SVJC64FM","tailwind-design-system",null,"Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.","gethamster\u002Fskills","gethamster","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F215697643?v=4","01M7B2R6PGB3SDZZ71E0WE2S74","Hamster","01M7B2R6Q21HWJRXZZWB78BNDG",4,"MIT","https:\u002F\u002Fgithub.com\u002Fgethamster\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F.experimental\u002Ftailwind-design-system\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tailwind-design-system\ndescription: \"Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.\"\nversion: \"1.1.0\"\n---\n\n# Tailwind Design System (v4)\n\nBuild production-ready design systems with Tailwind CSS v4, including CSS-first configuration, design tokens, component variants, responsive patterns, and accessibility.\n\n> **Note**: This skill targets Tailwind CSS v4 (2024+). For v3 projects, refer to the [upgrade guide](https:\u002F\u002Ftailwindcss.com\u002Fdocs\u002Fupgrade-guide).\n\n## When to Use This Skill\n\n- Creating a component library with Tailwind v4\n- Implementing design tokens and theming with CSS-first configuration\n- Building responsive and accessible components\n- Standardizing UI patterns across a codebase\n- Migrating from Tailwind v3 to v4\n- Setting up dark mode with native CSS features\n\n## Key v4 Changes\n\n| v3 Pattern | v4 Pattern |\n| --- | --- |\n| `tailwind.config.ts` | `@theme` in CSS |\n| `@tailwind base\u002Fcomponents\u002Futilities` | `@import \"tailwindcss\"` |\n| `darkMode: \"class\"` | `@custom-variant dark (&:where(.dark, .dark *))` |\n| `theme.extend.colors` | `@theme { --color-*: value }` |\n| `require(\"tailwindcss-animate\")` | CSS `@keyframes` in `@theme` + `@starting-style` for entry animations |\n\n## Quick Start\n\n```css\n\u002F* app.css - Tailwind v4 CSS-first configuration *\u002F\n@import \"tailwindcss\";\n\n\u002F* Define your theme with @theme *\u002F\n@theme {\n  \u002F* Semantic color tokens using OKLCH for better color perception *\u002F\n  --color-background: oklch(100% 0 0);\n  --color-foreground: oklch(14.5% 0.025 264);\n\n  --color-primary: oklch(14.5% 0.025 264);\n  --color-primary-foreground: oklch(98% 0.01 264);\n\n  --color-secondary: oklch(96% 0.01 264);\n  --color-secondary-foreground: oklch(14.5% 0.025 264);\n\n  --color-muted: oklch(96% 0.01 264);\n  --color-muted-foreground: oklch(46% 0.02 264);\n\n  --color-accent: oklch(96% 0.01 264);\n  --color-accent-foreground: oklch(14.5% 0.025 264);\n\n  --color-destructive: oklch(53% 0.22 27);\n  --color-destructive-foreground: oklch(98% 0.01 264);\n\n  --color-border: oklch(91% 0.01 264);\n  --color-ring: oklch(14.5% 0.025 264);\n\n  --color-card: oklch(100% 0 0);\n  --color-card-foreground: oklch(14.5% 0.025 264);\n\n  \u002F* Ring offset for focus states *\u002F\n  --color-ring-offset: oklch(100% 0 0);\n\n  \u002F* Radius tokens *\u002F\n  --radius-sm: 0.25rem;\n  --radius-md: 0.375rem;\n  --radius-lg: 0.5rem;\n  --radius-xl: 0.75rem;\n\n  \u002F* Animation tokens - keyframes inside @theme are output when referenced by --animate-* variables *\u002F\n  --animate-fade-in: fade-in 0.2s ease-out;\n  --animate-fade-out: fade-out 0.2s ease-in;\n  --animate-slide-in: slide-in 0.3s ease-out;\n  --animate-slide-out: slide-out 0.3s ease-in;\n\n  @keyframes fade-in {\n    from {\n      opacity: 0;\n    }\n    to {\n      opacity: 1;\n    }\n  }\n\n  @keyframes fade-out {\n    from {\n      opacity: 1;\n    }\n    to {\n      opacity: 0;\n    }\n  }\n\n  @keyframes slide-in {\n    from {\n      transform: translateY(-0.5rem);\n      opacity: 0;\n    }\n    to {\n      transform: translateY(0);\n      opacity: 1;\n    }\n  }\n\n  @keyframes slide-out {\n    from {\n      transform: translateY(0);\n      opacity: 1;\n    }\n    to {\n      transform: translateY(-0.5rem);\n      opacity: 0;\n    }\n  }\n}\n\n\u002F* Dark mode variant - use @custom-variant for class-based dark mode *\u002F\n@custom-variant dark (&:where(.dark, .dark *));\n\n\u002F* Dark mode theme overrides *\u002F\n.dark {\n  --color-background: oklch(14.5% 0.025 264);\n  --color-foreground: oklch(98% 0.01 264);\n\n  --color-primary: oklch(98% 0.01 264);\n  --color-primary-foreground: oklch(14.5% 0.025 264);\n\n  --color-secondary: oklch(22% 0.02 264);\n  --color-secondary-foreground: oklch(98% 0.01 264);\n\n  --color-muted: oklch(22% 0.02 264);\n  --color-muted-foreground: oklch(65% 0.02 264);\n\n  --color-accent: oklch(22% 0.02 264);\n  --color-accent-foreground: oklch(98% 0.01 264);\n\n  --color-destructive: oklch(42% 0.15 27);\n  --color-destructive-foreground: oklch(98% 0.01 264);\n\n  --color-border: oklch(22% 0.02 264);\n  --color-ring: oklch(83% 0.02 264);\n\n  --color-card: oklch(14.5% 0.025 264);\n  --color-card-foreground: oklch(98% 0.01 264);\n\n  --color-ring-offset: oklch(14.5% 0.025 264);\n}\n\n\u002F* Base styles *\u002F\n@layer base {\n  * {\n    @apply border-border;\n  }\n\n  body {\n    @apply bg-background text-foreground antialiased;\n  }\n}\n```\n\n## Core Concepts\n\n### 1. Design Token Hierarchy\n\n```\nBrand Tokens (abstract)\n    └── Semantic Tokens (purpose)\n        └── Component Tokens (specific)\n\nExample:\n    oklch(45% 0.2 260) → --color-primary → bg-primary\n```\n\n### 2. Component Architecture\n\n```\nBase styles → Variants → Sizes → States → Overrides\n```\n\n## Patterns\n\n### Pattern 1: CVA (Class Variance Authority) Components\n\n```typescript\n\u002F\u002F components\u002Fui\u002Fbutton.tsx\nimport { Slot } from '@radix-ui\u002Freact-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '@\u002Flib\u002Futils'\n\nconst buttonVariants = cva(\n  \u002F\u002F Base styles - v4 uses native CSS variables\n  'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n  {\n    variants: {\n      variant: {\n        default: 'bg-primary text-primary-foreground hover:bg-primary\u002F90',\n        destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive\u002F90',\n        outline: 'border border-border bg-background hover:bg-accent hover:text-accent-foreground',\n        secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary\u002F80',\n        ghost: 'hover:bg-accent hover:text-accent-foreground',\n        link: 'text-primary underline-offset-4 hover:underline',\n      },\n      size: {\n        default: 'h-10 px-4 py-2',\n        sm: 'h-9 rounded-md px-3',\n        lg: 'h-11 rounded-md px-8',\n        icon: 'size-10',\n      },\n    },\n    defaultVariants: {\n      variant: 'default',\n      size: 'default',\n    },\n  }\n)\n\nexport interface ButtonProps\n  extends React.ButtonHTMLAttributes\u003CHTMLButtonElement>,\n    VariantProps\u003Ctypeof buttonVariants> {\n  asChild?: boolean\n}\n\n\u002F\u002F React 19: No forwardRef needed\nexport function Button({\n  className,\n  variant,\n  size,\n  asChild = false,\n  ref,\n  ...props\n}: ButtonProps & { ref?: React.Ref\u003CHTMLButtonElement> }) {\n  const Comp = asChild ? Slot : 'button'\n  return (\n    \u003CComp\n      className={cn(buttonVariants({ variant, size, className }))}\n      ref={ref}\n      {...props}\n    \u002F>\n  )\n}\n\n\u002F\u002F Usage\n\u003CButton variant=\"destructive\" size=\"lg\">Delete\u003C\u002FButton>\n\u003CButton variant=\"outline\">Cancel\u003C\u002FButton>\n\u003CButton asChild>\u003CLink href=\"\u002Fhome\">Home\u003C\u002FLink>\u003C\u002FButton>\n```\n\n### Pattern 2: Compound Components (React 19)\n\n```typescript\n\u002F\u002F components\u002Fui\u002Fcard.tsx\nimport { cn } from '@\u002Flib\u002Futils'\n\n\u002F\u002F React 19: ref is a regular prop, no forwardRef\nexport function Card({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLDivElement> & { ref?: React.Ref\u003CHTMLDivElement> }) {\n  return (\n    \u003Cdiv\n      ref={ref}\n      className={cn(\n        'rounded-lg border border-border bg-card text-card-foreground shadow-sm',\n        className\n      )}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function CardHeader({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLDivElement> & { ref?: React.Ref\u003CHTMLDivElement> }) {\n  return (\n    \u003Cdiv\n      ref={ref}\n      className={cn('flex flex-col space-y-1.5 p-6', className)}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function CardTitle({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLHeadingElement> & { ref?: React.Ref\u003CHTMLHeadingElement> }) {\n  return (\n    \u003Ch3\n      ref={ref}\n      className={cn('text-2xl font-semibold leading-none tracking-tight', className)}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function CardDescription({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLParagraphElement> & { ref?: React.Ref\u003CHTMLParagraphElement> }) {\n  return (\n    \u003Cp\n      ref={ref}\n      className={cn('text-sm text-muted-foreground', className)}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function CardContent({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLDivElement> & { ref?: React.Ref\u003CHTMLDivElement> }) {\n  return (\n    \u003Cdiv ref={ref} className={cn('p-6 pt-0', className)} {...props} \u002F>\n  )\n}\n\nexport function CardFooter({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLDivElement> & { ref?: React.Ref\u003CHTMLDivElement> }) {\n  return (\n    \u003Cdiv\n      ref={ref}\n      className={cn('flex items-center p-6 pt-0', className)}\n      {...props}\n    \u002F>\n  )\n}\n\n\u002F\u002F Usage\n\u003CCard>\n  \u003CCardHeader>\n    \u003CCardTitle>Account\u003C\u002FCardTitle>\n    \u003CCardDescription>Manage your account settings\u003C\u002FCardDescription>\n  \u003C\u002FCardHeader>\n  \u003CCardContent>\n    \u003Cform>...\u003C\u002Fform>\n  \u003C\u002FCardContent>\n  \u003CCardFooter>\n    \u003CButton>Save\u003C\u002FButton>\n  \u003C\u002FCardFooter>\n\u003C\u002FCard>\n```\n\n### Pattern 3: Form Components\n\n```typescript\n\u002F\u002F components\u002Fui\u002Finput.tsx\nimport { cn } from '@\u002Flib\u002Futils'\n\nexport interface InputProps extends React.InputHTMLAttributes\u003CHTMLInputElement> {\n  error?: string\n  ref?: React.Ref\u003CHTMLInputElement>\n}\n\nexport function Input({ className, type, error, ref, ...props }: InputProps) {\n  return (\n    \u003Cdiv className=\"relative\">\n      \u003Cinput\n        type={type}\n        className={cn(\n          'flex h-10 w-full rounded-md border border-border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n          error && 'border-destructive focus-visible:ring-destructive',\n          className\n        )}\n        ref={ref}\n        aria-invalid={!!error}\n        aria-describedby={error ? `${props.id}-error` : undefined}\n        {...props}\n      \u002F>\n      {error && (\n        \u003Cp\n          id={`${props.id}-error`}\n          className=\"mt-1 text-sm text-destructive\"\n          role=\"alert\"\n        >\n          {error}\n        \u003C\u002Fp>\n      )}\n    \u003C\u002Fdiv>\n  )\n}\n\n\u002F\u002F components\u002Fui\u002Flabel.tsx\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst labelVariants = cva(\n  'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'\n)\n\nexport function Label({\n  className,\n  ref,\n  ...props\n}: React.LabelHTMLAttributes\u003CHTMLLabelElement> & { ref?: React.Ref\u003CHTMLLabelElement> }) {\n  return (\n    \u003Clabel ref={ref} className={cn(labelVariants(), className)} {...props} \u002F>\n  )\n}\n\n\u002F\u002F Usage with React Hook Form + Zod\nimport { useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform\u002Fresolvers\u002Fzod'\nimport { z } from 'zod'\n\nconst schema = z.object({\n  email: z.string().email('Invalid email address'),\n  password: z.string().min(8, 'Password must be at least 8 characters'),\n})\n\nfunction LoginForm() {\n  const { register, handleSubmit, formState: { errors } } = useForm({\n    resolver: zodResolver(schema),\n  })\n\n  return (\n    \u003Cform onSubmit={handleSubmit(onSubmit)} className=\"space-y-4\">\n      \u003Cdiv className=\"space-y-2\">\n        \u003CLabel htmlFor=\"email\">Email\u003C\u002FLabel>\n        \u003CInput\n          id=\"email\"\n          type=\"email\"\n          {...register('email')}\n          error={errors.email?.message}\n        \u002F>\n      \u003C\u002Fdiv>\n      \u003Cdiv className=\"space-y-2\">\n        \u003CLabel htmlFor=\"password\">Password\u003C\u002FLabel>\n        \u003CInput\n          id=\"password\"\n          type=\"password\"\n          {...register('password')}\n          error={errors.password?.message}\n        \u002F>\n      \u003C\u002Fdiv>\n      \u003CButton type=\"submit\" className=\"w-full\">Sign In\u003C\u002FButton>\n    \u003C\u002Fform>\n  )\n}\n```\n\n### Pattern 4: Responsive Grid System\n\n```typescript\n\u002F\u002F components\u002Fui\u002Fgrid.tsx\nimport { cn } from '@\u002Flib\u002Futils'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst gridVariants = cva('grid', {\n  variants: {\n    cols: {\n      1: 'grid-cols-1',\n      2: 'grid-cols-1 sm:grid-cols-2',\n      3: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3',\n      4: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4',\n      5: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-5',\n      6: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-6',\n    },\n    gap: {\n      none: 'gap-0',\n      sm: 'gap-2',\n      md: 'gap-4',\n      lg: 'gap-6',\n      xl: 'gap-8',\n    },\n  },\n  defaultVariants: {\n    cols: 3,\n    gap: 'md',\n  },\n})\n\ninterface GridProps\n  extends React.HTMLAttributes\u003CHTMLDivElement>,\n    VariantProps\u003Ctypeof gridVariants> {}\n\nexport function Grid({ className, cols, gap, ...props }: GridProps) {\n  return (\n    \u003Cdiv className={cn(gridVariants({ cols, gap, className }))} {...props} \u002F>\n  )\n}\n\n\u002F\u002F Container component\nconst containerVariants = cva('mx-auto w-full px-4 sm:px-6 lg:px-8', {\n  variants: {\n    size: {\n      sm: 'max-w-screen-sm',\n      md: 'max-w-screen-md',\n      lg: 'max-w-screen-lg',\n      xl: 'max-w-screen-xl',\n      '2xl': 'max-w-screen-2xl',\n      full: 'max-w-full',\n    },\n  },\n  defaultVariants: {\n    size: 'xl',\n  },\n})\n\ninterface ContainerProps\n  extends React.HTMLAttributes\u003CHTMLDivElement>,\n    VariantProps\u003Ctypeof containerVariants> {}\n\nexport function Container({ className, size, ...props }: ContainerProps) {\n  return (\n    \u003Cdiv className={cn(containerVariants({ size, className }))} {...props} \u002F>\n  )\n}\n\n\u002F\u002F Usage\n\u003CContainer>\n  \u003CGrid cols={4} gap=\"lg\">\n    {products.map((product) => (\n      \u003CProductCard key={product.id} product={product} \u002F>\n    ))}\n  \u003C\u002FGrid>\n\u003C\u002FContainer>\n```\n\n### Pattern 5: Native CSS Animations (v4)\n\n```css\n\u002F* In your CSS file - native @starting-style for entry animations *\u002F\n@theme {\n  --animate-dialog-in: dialog-fade-in 0.2s ease-out;\n  --animate-dialog-out: dialog-fade-out 0.15s ease-in;\n}\n\n@keyframes dialog-fade-in {\n  from {\n    opacity: 0;\n    transform: scale(0.95) translateY(-0.5rem);\n  }\n  to {\n    opacity: 1;\n    transform: scale(1) translateY(0);\n  }\n}\n\n@keyframes dialog-fade-out {\n  from {\n    opacity: 1;\n    transform: scale(1) translateY(0);\n  }\n  to {\n    opacity: 0;\n    transform: scale(0.95) translateY(-0.5rem);\n  }\n}\n\n\u002F* Native popover animations using @starting-style *\u002F\n[popover] {\n  transition:\n    opacity 0.2s,\n    transform 0.2s,\n    display 0.2s allow-discrete;\n  opacity: 0;\n  transform: scale(0.95);\n}\n\n[popover]:popover-open {\n  opacity: 1;\n  transform: scale(1);\n}\n\n@starting-style {\n  [popover]:popover-open {\n    opacity: 0;\n    transform: scale(0.95);\n  }\n}\n```\n\n```typescript\n\u002F\u002F components\u002Fui\u002Fdialog.tsx - Using native popover API\nimport * as DialogPrimitive from '@radix-ui\u002Freact-dialog'\nimport { cn } from '@\u002Flib\u002Futils'\n\nconst DialogPortal = DialogPrimitive.Portal\n\nexport function DialogOverlay({\n  className,\n  ref,\n  ...props\n}: React.ComponentPropsWithoutRef\u003Ctypeof DialogPrimitive.Overlay> & {\n  ref?: React.Ref\u003CHTMLDivElement>\n}) {\n  return (\n    \u003CDialogPrimitive.Overlay\n      ref={ref}\n      className={cn(\n        'fixed inset-0 z-50 bg-black\u002F80',\n        'data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out',\n        className\n      )}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function DialogContent({\n  className,\n  children,\n  ref,\n  ...props\n}: React.ComponentPropsWithoutRef\u003Ctypeof DialogPrimitive.Content> & {\n  ref?: React.Ref\u003CHTMLDivElement>\n}) {\n  return (\n    \u003CDialogPortal>\n      \u003CDialogOverlay \u002F>\n      \u003CDialogPrimitive.Content\n        ref={ref}\n        className={cn(\n          'fixed left-1\u002F2 top-1\u002F2 z-50 grid w-full max-w-lg -translate-x-1\u002F2 -translate-y-1\u002F2 gap-4 border border-border bg-background p-6 shadow-lg sm:rounded-lg',\n          'data-[state=open]:animate-dialog-in data-[state=closed]:animate-dialog-out',\n          className\n        )}\n        {...props}\n      >\n        {children}\n      \u003C\u002FDialogPrimitive.Content>\n    \u003C\u002FDialogPortal>\n  )\n}\n```\n\n### Pattern 6: Dark Mode with CSS (v4)\n\n```typescript\n\u002F\u002F providers\u002FThemeProvider.tsx - Simplified for v4\n'use client'\n\nimport { createContext, useContext, useEffect, useState } from 'react'\n\ntype Theme = 'dark' | 'light' | 'system'\n\ninterface ThemeContextType {\n  theme: Theme\n  setTheme: (theme: Theme) => void\n  resolvedTheme: 'dark' | 'light'\n}\n\nconst ThemeContext = createContext\u003CThemeContextType | undefined>(undefined)\n\nexport function ThemeProvider({\n  children,\n  defaultTheme = 'system',\n  storageKey = 'theme',\n}: {\n  children: React.ReactNode\n  defaultTheme?: Theme\n  storageKey?: string\n}) {\n  const [theme, setTheme] = useState\u003CTheme>(defaultTheme)\n  const [resolvedTheme, setResolvedTheme] = useState\u003C'dark' | 'light'>('light')\n\n  useEffect(() => {\n    const stored = localStorage.getItem(storageKey) as Theme | null\n    if (stored) setTheme(stored)\n  }, [storageKey])\n\n  useEffect(() => {\n    const root = document.documentElement\n    root.classList.remove('light', 'dark')\n\n    const resolved = theme === 'system'\n      ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n      : theme\n\n    root.classList.add(resolved)\n    setResolvedTheme(resolved)\n\n    \u002F\u002F Update meta theme-color for mobile browsers\n    const metaThemeColor = document.querySelector('meta[name=\"theme-color\"]')\n    if (metaThemeColor) {\n      metaThemeColor.setAttribute('content', resolved === 'dark' ? '#09090b' : '#ffffff')\n    }\n  }, [theme])\n\n  return (\n    \u003CThemeContext.Provider value={{\n      theme,\n      setTheme: (newTheme) => {\n        localStorage.setItem(storageKey, newTheme)\n        setTheme(newTheme)\n      },\n      resolvedTheme,\n    }}>\n      {children}\n    \u003C\u002FThemeContext.Provider>\n  )\n}\n\nexport const useTheme = () => {\n  const context = useContext(ThemeContext)\n  if (!context) throw new Error('useTheme must be used within ThemeProvider')\n  return context\n}\n\n\u002F\u002F components\u002FThemeToggle.tsx\nimport { Moon, Sun } from 'lucide-react'\nimport { useTheme } from '@\u002Fproviders\u002FThemeProvider'\n\nexport function ThemeToggle() {\n  const { resolvedTheme, setTheme } = useTheme()\n\n  return (\n    \u003CButton\n      variant=\"ghost\"\n      size=\"icon\"\n      onClick={() => setTheme(resolvedTheme === 'dark' ? 'light' : 'dark')}\n    >\n      \u003CSun className=\"size-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" \u002F>\n      \u003CMoon className=\"absolute size-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" \u002F>\n      \u003Cspan className=\"sr-only\">Toggle theme\u003C\u002Fspan>\n    \u003C\u002FButton>\n  )\n}\n```\n\n## Utility Functions\n\n```typescript\n\u002F\u002F lib\u002Futils.ts\nimport { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\n\u002F\u002F Focus ring utility\nexport const focusRing = cn(\n  \"focus-visible:outline-none focus-visible:ring-2\",\n  \"focus-visible:ring-ring focus-visible:ring-offset-2\",\n);\n\n\u002F\u002F Disabled utility\nexport const disabled = \"disabled:pointer-events-none disabled:opacity-50\";\n```\n\n## Advanced v4 Patterns\n\n### Custom Utilities with `@utility`\n\nDefine reusable custom utilities:\n\n```css\n\u002F* Custom utility for decorative lines *\u002F\n@utility line-t {\n  @apply relative before:absolute before:top-0 before:-left-[100vw] before:h-px before:w-[200vw] before:bg-gray-950\u002F5 dark:before:bg-white\u002F10;\n}\n\n\u002F* Custom utility for text gradients *\u002F\n@utility text-gradient {\n  @apply bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent;\n}\n```\n\n### Theme Modifiers\n\n```css\n\u002F* Use @theme inline when referencing other CSS variables *\u002F\n@theme inline {\n  --font-sans: var(--font-inter), system-ui;\n}\n\n\u002F* Use @theme static to always generate CSS variables (even when unused) *\u002F\n@theme static {\n  --color-brand: oklch(65% 0.15 240);\n}\n\n\u002F* Import with theme options *\u002F\n@import \"tailwindcss\" theme(static);\n```\n\n### Namespace Overrides\n\n```css\n@theme {\n  \u002F* Clear all default colors and define your own *\u002F\n  --color-*: initial;\n  --color-white: #fff;\n  --color-black: #000;\n  --color-primary: oklch(45% 0.2 260);\n  --color-secondary: oklch(65% 0.15 200);\n\n  \u002F* Clear ALL defaults for a minimal setup *\u002F\n  \u002F* --*: initial; *\u002F\n}\n```\n\n### Semi-transparent Color Variants\n\n```css\n@theme {\n  \u002F* Use color-mix() for alpha variants *\u002F\n  --color-primary-50: color-mix(in oklab, var(--color-primary) 5%, transparent);\n  --color-primary-100: color-mix(\n    in oklab,\n    var(--color-primary) 10%,\n    transparent\n  );\n  --color-primary-200: color-mix(\n    in oklab,\n    var(--color-primary) 20%,\n    transparent\n  );\n}\n```\n\n### Container Queries\n\n```css\n@theme {\n  --container-xs: 20rem;\n  --container-sm: 24rem;\n  --container-md: 28rem;\n  --container-lg: 32rem;\n}\n```\n\n## v3 to v4 Migration Checklist\n\n- [ ] Replace `tailwind.config.ts` with CSS `@theme` block\n- [ ] Change `@tailwind base\u002Fcomponents\u002Futilities` to `@import \"tailwindcss\"`\n- [ ] Move color definitions to `@theme { --color-*: value }`\n- [ ] Replace `darkMode: \"class\"` with `@custom-variant dark`\n- [ ] Move `@keyframes` inside `@theme` blocks (ensures keyframes output with theme)\n- [ ] Replace `require(\"tailwindcss-animate\")` with native CSS animations\n- [ ] Update `h-10 w-10` to `size-10` (new utility)\n- [ ] Remove `forwardRef` (React 19 passes ref as prop)\n- [ ] Consider OKLCH colors for better color perception\n- [ ] Replace custom plugins with `@utility` directives\n\n## Best Practices\n\n### Do's\n\n- **Use `@theme` blocks** - CSS-first configuration is v4's core pattern\n- **Use OKLCH colors** - Better perceptual uniformity than HSL\n- **Compose with CVA** - Type-safe variants\n- **Use semantic tokens** - `bg-primary` not `bg-blue-500`\n- **Use `size-*`** - New shorthand for `w- *h-*`\n- **Add accessibility** - ARIA attributes, focus states\n\n### Don'ts\n\n- **Don't use `tailwind.config.ts`** - Use CSS `@theme` instead\n- **Don't use `@tailwind` directives** - Use `@import \"tailwindcss\"`\n- **Don't use `forwardRef`** - React 19 passes ref as prop\n- **Don't use arbitrary values** - Extend `@theme` instead\n- **Don't hardcode colors** - Use semantic tokens\n- **Don't forget dark mode** - Test both themes\n\n## Resources\n\n- [Tailwind CSS v4 Documentation](https:\u002F\u002Ftailwindcss.com\u002Fdocs)\n- [Tailwind v4 Beta Announcement](https:\u002F\u002Ftailwindcss.com\u002Fblog\u002Ftailwindcss-v4-beta)\n- [CVA Documentation](https:\u002F\u002Fcva.style\u002Fdocs)\n- [shadcn\u002Fui](https:\u002F\u002Fui.shadcn.com\u002F)\n- [Radix Primitives](https:\u002F\u002Fwww.radix-ui.com\u002Fprimitives)\n","# Tailwind Design System (v4)\n\nBuild production-ready design systems with Tailwind CSS v4, including CSS-first configuration, design tokens, component variants, responsive patterns, and accessibility.\n\n> **Note**: This skill targets Tailwind CSS v4 (2024+). For v3 projects, refer to the [upgrade guide](https:\u002F\u002Ftailwindcss.com\u002Fdocs\u002Fupgrade-guide).\n\n## When to Use This Skill\n\n- Creating a component library with Tailwind v4\n- Implementing design tokens and theming with CSS-first configuration\n- Building responsive and accessible components\n- Standardizing UI patterns across a codebase\n- Migrating from Tailwind v3 to v4\n- Setting up dark mode with native CSS features\n\n## Key v4 Changes\n\n| v3 Pattern | v4 Pattern |\n| --- | --- |\n| `tailwind.config.ts` | `@theme` in CSS |\n| `@tailwind base\u002Fcomponents\u002Futilities` | `@import \"tailwindcss\"` |\n| `darkMode: \"class\"` | `@custom-variant dark (&:where(.dark, .dark *))` |\n| `theme.extend.colors` | `@theme { --color-*: value }` |\n| `require(\"tailwindcss-animate\")` | CSS `@keyframes` in `@theme` + `@starting-style` for entry animations |\n\n## Quick Start\n\n```css\n\u002F* app.css - Tailwind v4 CSS-first configuration *\u002F\n@import \"tailwindcss\";\n\n\u002F* Define your theme with @theme *\u002F\n@theme {\n  \u002F* Semantic color tokens using OKLCH for better color perception *\u002F\n  --color-background: oklch(100% 0 0);\n  --color-foreground: oklch(14.5% 0.025 264);\n\n  --color-primary: oklch(14.5% 0.025 264);\n  --color-primary-foreground: oklch(98% 0.01 264);\n\n  --color-secondary: oklch(96% 0.01 264);\n  --color-secondary-foreground: oklch(14.5% 0.025 264);\n\n  --color-muted: oklch(96% 0.01 264);\n  --color-muted-foreground: oklch(46% 0.02 264);\n\n  --color-accent: oklch(96% 0.01 264);\n  --color-accent-foreground: oklch(14.5% 0.025 264);\n\n  --color-destructive: oklch(53% 0.22 27);\n  --color-destructive-foreground: oklch(98% 0.01 264);\n\n  --color-border: oklch(91% 0.01 264);\n  --color-ring: oklch(14.5% 0.025 264);\n\n  --color-card: oklch(100% 0 0);\n  --color-card-foreground: oklch(14.5% 0.025 264);\n\n  \u002F* Ring offset for focus states *\u002F\n  --color-ring-offset: oklch(100% 0 0);\n\n  \u002F* Radius tokens *\u002F\n  --radius-sm: 0.25rem;\n  --radius-md: 0.375rem;\n  --radius-lg: 0.5rem;\n  --radius-xl: 0.75rem;\n\n  \u002F* Animation tokens - keyframes inside @theme are output when referenced by --animate-* variables *\u002F\n  --animate-fade-in: fade-in 0.2s ease-out;\n  --animate-fade-out: fade-out 0.2s ease-in;\n  --animate-slide-in: slide-in 0.3s ease-out;\n  --animate-slide-out: slide-out 0.3s ease-in;\n\n  @keyframes fade-in {\n    from {\n      opacity: 0;\n    }\n    to {\n      opacity: 1;\n    }\n  }\n\n  @keyframes fade-out {\n    from {\n      opacity: 1;\n    }\n    to {\n      opacity: 0;\n    }\n  }\n\n  @keyframes slide-in {\n    from {\n      transform: translateY(-0.5rem);\n      opacity: 0;\n    }\n    to {\n      transform: translateY(0);\n      opacity: 1;\n    }\n  }\n\n  @keyframes slide-out {\n    from {\n      transform: translateY(0);\n      opacity: 1;\n    }\n    to {\n      transform: translateY(-0.5rem);\n      opacity: 0;\n    }\n  }\n}\n\n\u002F* Dark mode variant - use @custom-variant for class-based dark mode *\u002F\n@custom-variant dark (&:where(.dark, .dark *));\n\n\u002F* Dark mode theme overrides *\u002F\n.dark {\n  --color-background: oklch(14.5% 0.025 264);\n  --color-foreground: oklch(98% 0.01 264);\n\n  --color-primary: oklch(98% 0.01 264);\n  --color-primary-foreground: oklch(14.5% 0.025 264);\n\n  --color-secondary: oklch(22% 0.02 264);\n  --color-secondary-foreground: oklch(98% 0.01 264);\n\n  --color-muted: oklch(22% 0.02 264);\n  --color-muted-foreground: oklch(65% 0.02 264);\n\n  --color-accent: oklch(22% 0.02 264);\n  --color-accent-foreground: oklch(98% 0.01 264);\n\n  --color-destructive: oklch(42% 0.15 27);\n  --color-destructive-foreground: oklch(98% 0.01 264);\n\n  --color-border: oklch(22% 0.02 264);\n  --color-ring: oklch(83% 0.02 264);\n\n  --color-card: oklch(14.5% 0.025 264);\n  --color-card-foreground: oklch(98% 0.01 264);\n\n  --color-ring-offset: oklch(14.5% 0.025 264);\n}\n\n\u002F* Base styles *\u002F\n@layer base {\n  * {\n    @apply border-border;\n  }\n\n  body {\n    @apply bg-background text-foreground antialiased;\n  }\n}\n```\n\n## Core Concepts\n\n### 1. Design Token Hierarchy\n\n```\nBrand Tokens (abstract)\n    └── Semantic Tokens (purpose)\n        └── Component Tokens (specific)\n\nExample:\n    oklch(45% 0.2 260) → --color-primary → bg-primary\n```\n\n### 2. Component Architecture\n\n```\nBase styles → Variants → Sizes → States → Overrides\n```\n\n## Patterns\n\n### Pattern 1: CVA (Class Variance Authority) Components\n\n```typescript\n\u002F\u002F components\u002Fui\u002Fbutton.tsx\nimport { Slot } from '@radix-ui\u002Freact-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '@\u002Flib\u002Futils'\n\nconst buttonVariants = cva(\n  \u002F\u002F Base styles - v4 uses native CSS variables\n  'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n  {\n    variants: {\n      variant: {\n        default: 'bg-primary text-primary-foreground hover:bg-primary\u002F90',\n        destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive\u002F90',\n        outline: 'border border-border bg-background hover:bg-accent hover:text-accent-foreground',\n        secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary\u002F80',\n        ghost: 'hover:bg-accent hover:text-accent-foreground',\n        link: 'text-primary underline-offset-4 hover:underline',\n      },\n      size: {\n        default: 'h-10 px-4 py-2',\n        sm: 'h-9 rounded-md px-3',\n        lg: 'h-11 rounded-md px-8',\n        icon: 'size-10',\n      },\n    },\n    defaultVariants: {\n      variant: 'default',\n      size: 'default',\n    },\n  }\n)\n\nexport interface ButtonProps\n  extends React.ButtonHTMLAttributes\u003CHTMLButtonElement>,\n    VariantProps\u003Ctypeof buttonVariants> {\n  asChild?: boolean\n}\n\n\u002F\u002F React 19: No forwardRef needed\nexport function Button({\n  className,\n  variant,\n  size,\n  asChild = false,\n  ref,\n  ...props\n}: ButtonProps & { ref?: React.Ref\u003CHTMLButtonElement> }) {\n  const Comp = asChild ? Slot : 'button'\n  return (\n    \u003CComp\n      className={cn(buttonVariants({ variant, size, className }))}\n      ref={ref}\n      {...props}\n    \u002F>\n  )\n}\n\n\u002F\u002F Usage\n\u003CButton variant=\"destructive\" size=\"lg\">Delete\u003C\u002FButton>\n\u003CButton variant=\"outline\">Cancel\u003C\u002FButton>\n\u003CButton asChild>\u003CLink href=\"\u002Fhome\">Home\u003C\u002FLink>\u003C\u002FButton>\n```\n\n### Pattern 2: Compound Components (React 19)\n\n```typescript\n\u002F\u002F components\u002Fui\u002Fcard.tsx\nimport { cn } from '@\u002Flib\u002Futils'\n\n\u002F\u002F React 19: ref is a regular prop, no forwardRef\nexport function Card({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLDivElement> & { ref?: React.Ref\u003CHTMLDivElement> }) {\n  return (\n    \u003Cdiv\n      ref={ref}\n      className={cn(\n        'rounded-lg border border-border bg-card text-card-foreground shadow-sm',\n        className\n      )}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function CardHeader({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLDivElement> & { ref?: React.Ref\u003CHTMLDivElement> }) {\n  return (\n    \u003Cdiv\n      ref={ref}\n      className={cn('flex flex-col space-y-1.5 p-6', className)}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function CardTitle({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLHeadingElement> & { ref?: React.Ref\u003CHTMLHeadingElement> }) {\n  return (\n    \u003Ch3\n      ref={ref}\n      className={cn('text-2xl font-semibold leading-none tracking-tight', className)}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function CardDescription({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLParagraphElement> & { ref?: React.Ref\u003CHTMLParagraphElement> }) {\n  return (\n    \u003Cp\n      ref={ref}\n      className={cn('text-sm text-muted-foreground', className)}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function CardContent({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLDivElement> & { ref?: React.Ref\u003CHTMLDivElement> }) {\n  return (\n    \u003Cdiv ref={ref} className={cn('p-6 pt-0', className)} {...props} \u002F>\n  )\n}\n\nexport function CardFooter({\n  className,\n  ref,\n  ...props\n}: React.HTMLAttributes\u003CHTMLDivElement> & { ref?: React.Ref\u003CHTMLDivElement> }) {\n  return (\n    \u003Cdiv\n      ref={ref}\n      className={cn('flex items-center p-6 pt-0', className)}\n      {...props}\n    \u002F>\n  )\n}\n\n\u002F\u002F Usage\n\u003CCard>\n  \u003CCardHeader>\n    \u003CCardTitle>Account\u003C\u002FCardTitle>\n    \u003CCardDescription>Manage your account settings\u003C\u002FCardDescription>\n  \u003C\u002FCardHeader>\n  \u003CCardContent>\n    \u003Cform>...\u003C\u002Fform>\n  \u003C\u002FCardContent>\n  \u003CCardFooter>\n    \u003CButton>Save\u003C\u002FButton>\n  \u003C\u002FCardFooter>\n\u003C\u002FCard>\n```\n\n### Pattern 3: Form Components\n\n```typescript\n\u002F\u002F components\u002Fui\u002Finput.tsx\nimport { cn } from '@\u002Flib\u002Futils'\n\nexport interface InputProps extends React.InputHTMLAttributes\u003CHTMLInputElement> {\n  error?: string\n  ref?: React.Ref\u003CHTMLInputElement>\n}\n\nexport function Input({ className, type, error, ref, ...props }: InputProps) {\n  return (\n    \u003Cdiv className=\"relative\">\n      \u003Cinput\n        type={type}\n        className={cn(\n          'flex h-10 w-full rounded-md border border-border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n          error && 'border-destructive focus-visible:ring-destructive',\n          className\n        )}\n        ref={ref}\n        aria-invalid={!!error}\n        aria-describedby={error ? `${props.id}-error` : undefined}\n        {...props}\n      \u002F>\n      {error && (\n        \u003Cp\n          id={`${props.id}-error`}\n          className=\"mt-1 text-sm text-destructive\"\n          role=\"alert\"\n        >\n          {error}\n        \u003C\u002Fp>\n      )}\n    \u003C\u002Fdiv>\n  )\n}\n\n\u002F\u002F components\u002Fui\u002Flabel.tsx\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst labelVariants = cva(\n  'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'\n)\n\nexport function Label({\n  className,\n  ref,\n  ...props\n}: React.LabelHTMLAttributes\u003CHTMLLabelElement> & { ref?: React.Ref\u003CHTMLLabelElement> }) {\n  return (\n    \u003Clabel ref={ref} className={cn(labelVariants(), className)} {...props} \u002F>\n  )\n}\n\n\u002F\u002F Usage with React Hook Form + Zod\nimport { useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform\u002Fresolvers\u002Fzod'\nimport { z } from 'zod'\n\nconst schema = z.object({\n  email: z.string().email('Invalid email address'),\n  password: z.string().min(8, 'Password must be at least 8 characters'),\n})\n\nfunction LoginForm() {\n  const { register, handleSubmit, formState: { errors } } = useForm({\n    resolver: zodResolver(schema),\n  })\n\n  return (\n    \u003Cform onSubmit={handleSubmit(onSubmit)} className=\"space-y-4\">\n      \u003Cdiv className=\"space-y-2\">\n        \u003CLabel htmlFor=\"email\">Email\u003C\u002FLabel>\n        \u003CInput\n          id=\"email\"\n          type=\"email\"\n          {...register('email')}\n          error={errors.email?.message}\n        \u002F>\n      \u003C\u002Fdiv>\n      \u003Cdiv className=\"space-y-2\">\n        \u003CLabel htmlFor=\"password\">Password\u003C\u002FLabel>\n        \u003CInput\n          id=\"password\"\n          type=\"password\"\n          {...register('password')}\n          error={errors.password?.message}\n        \u002F>\n      \u003C\u002Fdiv>\n      \u003CButton type=\"submit\" className=\"w-full\">Sign In\u003C\u002FButton>\n    \u003C\u002Fform>\n  )\n}\n```\n\n### Pattern 4: Responsive Grid System\n\n```typescript\n\u002F\u002F components\u002Fui\u002Fgrid.tsx\nimport { cn } from '@\u002Flib\u002Futils'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst gridVariants = cva('grid', {\n  variants: {\n    cols: {\n      1: 'grid-cols-1',\n      2: 'grid-cols-1 sm:grid-cols-2',\n      3: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3',\n      4: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4',\n      5: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-5',\n      6: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-6',\n    },\n    gap: {\n      none: 'gap-0',\n      sm: 'gap-2',\n      md: 'gap-4',\n      lg: 'gap-6',\n      xl: 'gap-8',\n    },\n  },\n  defaultVariants: {\n    cols: 3,\n    gap: 'md',\n  },\n})\n\ninterface GridProps\n  extends React.HTMLAttributes\u003CHTMLDivElement>,\n    VariantProps\u003Ctypeof gridVariants> {}\n\nexport function Grid({ className, cols, gap, ...props }: GridProps) {\n  return (\n    \u003Cdiv className={cn(gridVariants({ cols, gap, className }))} {...props} \u002F>\n  )\n}\n\n\u002F\u002F Container component\nconst containerVariants = cva('mx-auto w-full px-4 sm:px-6 lg:px-8', {\n  variants: {\n    size: {\n      sm: 'max-w-screen-sm',\n      md: 'max-w-screen-md',\n      lg: 'max-w-screen-lg',\n      xl: 'max-w-screen-xl',\n      '2xl': 'max-w-screen-2xl',\n      full: 'max-w-full',\n    },\n  },\n  defaultVariants: {\n    size: 'xl',\n  },\n})\n\ninterface ContainerProps\n  extends React.HTMLAttributes\u003CHTMLDivElement>,\n    VariantProps\u003Ctypeof containerVariants> {}\n\nexport function Container({ className, size, ...props }: ContainerProps) {\n  return (\n    \u003Cdiv className={cn(containerVariants({ size, className }))} {...props} \u002F>\n  )\n}\n\n\u002F\u002F Usage\n\u003CContainer>\n  \u003CGrid cols={4} gap=\"lg\">\n    {products.map((product) => (\n      \u003CProductCard key={product.id} product={product} \u002F>\n    ))}\n  \u003C\u002FGrid>\n\u003C\u002FContainer>\n```\n\n### Pattern 5: Native CSS Animations (v4)\n\n```css\n\u002F* In your CSS file - native @starting-style for entry animations *\u002F\n@theme {\n  --animate-dialog-in: dialog-fade-in 0.2s ease-out;\n  --animate-dialog-out: dialog-fade-out 0.15s ease-in;\n}\n\n@keyframes dialog-fade-in {\n  from {\n    opacity: 0;\n    transform: scale(0.95) translateY(-0.5rem);\n  }\n  to {\n    opacity: 1;\n    transform: scale(1) translateY(0);\n  }\n}\n\n@keyframes dialog-fade-out {\n  from {\n    opacity: 1;\n    transform: scale(1) translateY(0);\n  }\n  to {\n    opacity: 0;\n    transform: scale(0.95) translateY(-0.5rem);\n  }\n}\n\n\u002F* Native popover animations using @starting-style *\u002F\n[popover] {\n  transition:\n    opacity 0.2s,\n    transform 0.2s,\n    display 0.2s allow-discrete;\n  opacity: 0;\n  transform: scale(0.95);\n}\n\n[popover]:popover-open {\n  opacity: 1;\n  transform: scale(1);\n}\n\n@starting-style {\n  [popover]:popover-open {\n    opacity: 0;\n    transform: scale(0.95);\n  }\n}\n```\n\n```typescript\n\u002F\u002F components\u002Fui\u002Fdialog.tsx - Using native popover API\nimport * as DialogPrimitive from '@radix-ui\u002Freact-dialog'\nimport { cn } from '@\u002Flib\u002Futils'\n\nconst DialogPortal = DialogPrimitive.Portal\n\nexport function DialogOverlay({\n  className,\n  ref,\n  ...props\n}: React.ComponentPropsWithoutRef\u003Ctypeof DialogPrimitive.Overlay> & {\n  ref?: React.Ref\u003CHTMLDivElement>\n}) {\n  return (\n    \u003CDialogPrimitive.Overlay\n      ref={ref}\n      className={cn(\n        'fixed inset-0 z-50 bg-black\u002F80',\n        'data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out',\n        className\n      )}\n      {...props}\n    \u002F>\n  )\n}\n\nexport function DialogContent({\n  className,\n  children,\n  ref,\n  ...props\n}: React.ComponentPropsWithoutRef\u003Ctypeof DialogPrimitive.Content> & {\n  ref?: React.Ref\u003CHTMLDivElement>\n}) {\n  return (\n    \u003CDialogPortal>\n      \u003CDialogOverlay \u002F>\n      \u003CDialogPrimitive.Content\n        ref={ref}\n        className={cn(\n          'fixed left-1\u002F2 top-1\u002F2 z-50 grid w-full max-w-lg -translate-x-1\u002F2 -translate-y-1\u002F2 gap-4 border border-border bg-background p-6 shadow-lg sm:rounded-lg',\n          'data-[state=open]:animate-dialog-in data-[state=closed]:animate-dialog-out',\n          className\n        )}\n        {...props}\n      >\n        {children}\n      \u003C\u002FDialogPrimitive.Content>\n    \u003C\u002FDialogPortal>\n  )\n}\n```\n\n### Pattern 6: Dark Mode with CSS (v4)\n\n```typescript\n\u002F\u002F providers\u002FThemeProvider.tsx - Simplified for v4\n'use client'\n\nimport { createContext, useContext, useEffect, useState } from 'react'\n\ntype Theme = 'dark' | 'light' | 'system'\n\ninterface ThemeContextType {\n  theme: Theme\n  setTheme: (theme: Theme) => void\n  resolvedTheme: 'dark' | 'light'\n}\n\nconst ThemeContext = createContext\u003CThemeContextType | undefined>(undefined)\n\nexport function ThemeProvider({\n  children,\n  defaultTheme = 'system',\n  storageKey = 'theme',\n}: {\n  children: React.ReactNode\n  defaultTheme?: Theme\n  storageKey?: string\n}) {\n  const [theme, setTheme] = useState\u003CTheme>(defaultTheme)\n  const [resolvedTheme, setResolvedTheme] = useState\u003C'dark' | 'light'>('light')\n\n  useEffect(() => {\n    const stored = localStorage.getItem(storageKey) as Theme | null\n    if (stored) setTheme(stored)\n  }, [storageKey])\n\n  useEffect(() => {\n    const root = document.documentElement\n    root.classList.remove('light', 'dark')\n\n    const resolved = theme === 'system'\n      ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n      : theme\n\n    root.classList.add(resolved)\n    setResolvedTheme(resolved)\n\n    \u002F\u002F Update meta theme-color for mobile browsers\n    const metaThemeColor = document.querySelector('meta[name=\"theme-color\"]')\n    if (metaThemeColor) {\n      metaThemeColor.setAttribute('content', resolved === 'dark' ? '#09090b' : '#ffffff')\n    }\n  }, [theme])\n\n  return (\n    \u003CThemeContext.Provider value={{\n      theme,\n      setTheme: (newTheme) => {\n        localStorage.setItem(storageKey, newTheme)\n        setTheme(newTheme)\n      },\n      resolvedTheme,\n    }}>\n      {children}\n    \u003C\u002FThemeContext.Provider>\n  )\n}\n\nexport const useTheme = () => {\n  const context = useContext(ThemeContext)\n  if (!context) throw new Error('useTheme must be used within ThemeProvider')\n  return context\n}\n\n\u002F\u002F components\u002FThemeToggle.tsx\nimport { Moon, Sun } from 'lucide-react'\nimport { useTheme } from '@\u002Fproviders\u002FThemeProvider'\n\nexport function ThemeToggle() {\n  const { resolvedTheme, setTheme } = useTheme()\n\n  return (\n    \u003CButton\n      variant=\"ghost\"\n      size=\"icon\"\n      onClick={() => setTheme(resolvedTheme === 'dark' ? 'light' : 'dark')}\n    >\n      \u003CSun className=\"size-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" \u002F>\n      \u003CMoon className=\"absolute size-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" \u002F>\n      \u003Cspan className=\"sr-only\">Toggle theme\u003C\u002Fspan>\n    \u003C\u002FButton>\n  )\n}\n```\n\n## Utility Functions\n\n```typescript\n\u002F\u002F lib\u002Futils.ts\nimport { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\n\u002F\u002F Focus ring utility\nexport const focusRing = cn(\n  \"focus-visible:outline-none focus-visible:ring-2\",\n  \"focus-visible:ring-ring focus-visible:ring-offset-2\",\n);\n\n\u002F\u002F Disabled utility\nexport const disabled = \"disabled:pointer-events-none disabled:opacity-50\";\n```\n\n## Advanced v4 Patterns\n\n### Custom Utilities with `@utility`\n\nDefine reusable custom utilities:\n\n```css\n\u002F* Custom utility for decorative lines *\u002F\n@utility line-t {\n  @apply relative before:absolute before:top-0 before:-left-[100vw] before:h-px before:w-[200vw] before:bg-gray-950\u002F5 dark:before:bg-white\u002F10;\n}\n\n\u002F* Custom utility for text gradients *\u002F\n@utility text-gradient {\n  @apply bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent;\n}\n```\n\n### Theme Modifiers\n\n```css\n\u002F* Use @theme inline when referencing other CSS variables *\u002F\n@theme inline {\n  --font-sans: var(--font-inter), system-ui;\n}\n\n\u002F* Use @theme static to always generate CSS variables (even when unused) *\u002F\n@theme static {\n  --color-brand: oklch(65% 0.15 240);\n}\n\n\u002F* Import with theme options *\u002F\n@import \"tailwindcss\" theme(static);\n```\n\n### Namespace Overrides\n\n```css\n@theme {\n  \u002F* Clear all default colors and define your own *\u002F\n  --color-*: initial;\n  --color-white: #fff;\n  --color-black: #000;\n  --color-primary: oklch(45% 0.2 260);\n  --color-secondary: oklch(65% 0.15 200);\n\n  \u002F* Clear ALL defaults for a minimal setup *\u002F\n  \u002F* --*: initial; *\u002F\n}\n```\n\n### Semi-transparent Color Variants\n\n```css\n@theme {\n  \u002F* Use color-mix() for alpha variants *\u002F\n  --color-primary-50: color-mix(in oklab, var(--color-primary) 5%, transparent);\n  --color-primary-100: color-mix(\n    in oklab,\n    var(--color-primary) 10%,\n    transparent\n  );\n  --color-primary-200: color-mix(\n    in oklab,\n    var(--color-primary) 20%,\n    transparent\n  );\n}\n```\n\n### Container Queries\n\n```css\n@theme {\n  --container-xs: 20rem;\n  --container-sm: 24rem;\n  --container-md: 28rem;\n  --container-lg: 32rem;\n}\n```\n\n## v3 to v4 Migration Checklist\n\n- [ ] Replace `tailwind.config.ts` with CSS `@theme` block\n- [ ] Change `@tailwind base\u002Fcomponents\u002Futilities` to `@import \"tailwindcss\"`\n- [ ] Move color definitions to `@theme { --color-*: value }`\n- [ ] Replace `darkMode: \"class\"` with `@custom-variant dark`\n- [ ] Move `@keyframes` inside `@theme` blocks (ensures keyframes output with theme)\n- [ ] Replace `require(\"tailwindcss-animate\")` with native CSS animations\n- [ ] Update `h-10 w-10` to `size-10` (new utility)\n- [ ] Remove `forwardRef` (React 19 passes ref as prop)\n- [ ] Consider OKLCH colors for better color perception\n- [ ] Replace custom plugins with `@utility` directives\n\n## Best Practices\n\n### Do's\n\n- **Use `@theme` blocks** - CSS-first configuration is v4's core pattern\n- **Use OKLCH colors** - Better perceptual uniformity than HSL\n- **Compose with CVA** - Type-safe variants\n- **Use semantic tokens** - `bg-primary` not `bg-blue-500`\n- **Use `size-*`** - New shorthand for `w- *h-*`\n- **Add accessibility** - ARIA attributes, focus states\n\n### Don'ts\n\n- **Don't use `tailwind.config.ts`** - Use CSS `@theme` instead\n- **Don't use `@tailwind` directives** - Use `@import \"tailwindcss\"`\n- **Don't use `forwardRef`** - React 19 passes ref as prop\n- **Don't use arbitrary values** - Extend `@theme` instead\n- **Don't hardcode colors** - Use semantic tokens\n- **Don't forget dark mode** - Test both themes\n\n## Resources\n\n- [Tailwind CSS v4 Documentation](https:\u002F\u002Ftailwindcss.com\u002Fdocs)\n- [Tailwind v4 Beta Announcement](https:\u002F\u002Ftailwindcss.com\u002Fblog\u002Ftailwindcss-v4-beta)\n- [CVA Documentation](https:\u002F\u002Fcva.style\u002Fdocs)\n- [shadcn\u002Fui](https:\u002F\u002Fui.shadcn.com\u002F)\n- [Radix Primitives](https:\u002F\u002Fwww.radix-ui.com\u002Fprimitives)\n",{"name":5,"version":24,"description":7},"1.1.0","main","fe3bb1476c3ec23d8a366eac0fa8cd9f0852360a","skills\u002F.experimental\u002Ftailwind-design-system",0,"https:\u002F\u002Fgithub.com\u002Fgethamster\u002Fskills","https:\u002F\u002Fgithub.com\u002Fgethamster","https:\u002F\u002Ftryhamster.com","We're building the AI-native future of work, unlocking the promised acceleration for your whole team, from idea to impact.","2026-11-05 11:33:33",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add gethamster\u002Fskills --skill tailwind-design-system",{"tool":40,"command":41},"bunx","bunx skills add gethamster\u002Fskills --skill tailwind-design-system",{"tool":43,"command":44},"pnpm","pnpm dlx skills add gethamster\u002Fskills --skill tailwind-design-system","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgethamster\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F.experimental\u002Ftailwind-design-system\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7B5MWYW0KE251276S56KQDZ","writing-waterfall-requirements-documents","Write a waterfall requirements document: elicit, structure and review testable, traceable requirements, then baseline the specification before design.","https:\u002F\u002Fgithub.com\u002Fgethamster\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-waterfall-requirements-documents\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7B5MRCXWWPKREPB1CHQ7H90","writing-vision-and-values-statements","Write a V2MOM vision a reader can test and a ranked list of values that settles real tradeoffs, so the rest of the document has a clear anchor.","https:\u002F\u002Fgithub.com\u002Fgethamster\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-vision-and-values-statements\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7B5MKH2CH22YZAHQW3080VQ","writing-system-prompts-for-claude","Write Claude prompts and CLAUDE.md files that supply exact inputs, scope the task, and define done so the first attempt can be checked.","https:\u002F\u002Fgithub.com\u002Fgethamster\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-system-prompts-for-claude\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7B5ME1Y3X9RNRKP5HKHKACZ","writing-page-specific-website-copy","Website copywriting by page type: write homepage, landing page, pricing page and feature page copy that fits each page's visitor and single job.","https:\u002F\u002Fgithub.com\u002Fgethamster\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-page-specific-website-copy\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7B5M8MQNM8MN8PYH6BVWJ2B","writing-internal-press-releases","How to write an internal press release: the one-page working backwards press release that opens a PR\u002FFAQ document before anything is built.","https:\u002F\u002Fgithub.com\u002Fgethamster\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-internal-press-releases\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7B5M3P3YH1XF37R8PWXXSBK","writing-email-sequences-that-sell","Email sequence copywriting for nurture and sales: give each email one job, write clear subject lines, and close with one specific call to action.","https:\u002F\u002Fgithub.com\u002Fgethamster\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-email-sequences-that-sell\u002FSKILL.md",[],[]]