[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6K5G63FJFRN8WTF7ME3ZQY4":3,"skill-same:01M6K5G63FJFRN8WTF7ME3ZQY4":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":13,"repositoryHtmlUrl":59,"repositoryHomepageUrl":6,"ownerHtmlUrl":60,"ownerBlogUrl":6,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6K5G63FJFRN8WTF7ME3ZQY4","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.","glows777\u002Fflux","glows777","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F74138412?v=4","01M6K5FSGY91N7ANGRFSXFR8Y7","01M6K5FSMTTJ0DVCJNBW8BT5SH",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fglows777\u002Fflux\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftailwind-design-system\u002FSKILL.md",[17,22,25],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"design system","Tailwind","tailwind design system","system","design","use","implementing","with","Scalable","systems","tokens","responsive","patterns","build","design tokens","ui","design systems","libraries","component","css","2026-11-10 10:12:30",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.\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,"description":7},"main","ead41175d8411071f1ff14c63ac96debeab8671e",".agents\u002Fskills\u002Ftailwind-design-system","https:\u002F\u002Fgithub.com\u002Fglows777\u002Fflux","https:\u002F\u002Fgithub.com\u002Fglows777","学而知不足","2026-05-12 00:18:04",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add glows777\u002Fflux --skill tailwind-design-system",{"tool":69,"command":70},"bunx","bunx skills add glows777\u002Fflux --skill tailwind-design-system",{"tool":72,"command":73},"pnpm","pnpm dlx skills add glows777\u002Fflux --skill tailwind-design-system","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fglows777\u002Fflux\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftailwind-design-system\u002FSKILL.md",true,[],[78,98,124,149,168,189],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":87,"publishedAt":51},"01M6K5H4PFQXGV4HCFSJN14DJM","hello-world","A test skill that greets the user. Use for testing skill infrastructure.","https:\u002F\u002Fgithub.com\u002Fglows777\u002Fflux\u002Fblob\u002Fmain\u002Fpackages\u002Fserver\u002Fskills\u002Fhello-world\u002FSKILL.md",[84],{"categoryNo":85,"categoryName":86,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量",[88,89,90,91,92,93,94,95,96,36,97],"hello world","hello","world","testing","test","Test Skill","infrastructure","testing skill","user","for",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":106,"publishedAt":51},"01M6K5GZVBJQ37NPKCZJ5QXCNQ","web-design-guidelines","Review UI code for Web Interface Guidelines compliance. Use when asked to \"review my UI\", \"check accessibility\", \"audit design\", \"review UX\", or \"check my site against best practices\".","https:\u002F\u002Fgithub.com\u002Fglows777\u002Fflux\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[104,105],{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[35,107,108,109,110,111,112,113,114,115,116,117,118,119,36,120,121,122,123,97],"web","guidelines","web design guidelines","web design","review","accessibility","code","best practices","ux","file","audit","compliance","check","vercel","pattern","web interface guidelines","interface",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":128,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":132,"publishedAt":51},"01M6K5GPC1FYXW0A3QWWJ9VG30","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","MIT","https:\u002F\u002Fgithub.com\u002Fglows777\u002Fflux\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[131],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[133,134,114,135,120,136,137,138,139,108,140,113,141,142,143,144,145,146,147,148],"react","vercel react best practices","react best practices","writing","performance","components","react components","tasks","Optimization","Next.js","refactoring","performance optimization","next","pages","triggers","data fetching",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":128,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":156,"publishedAt":51},"01M6K5GG8X0GJBVZXR1D7E536K","vercel-composition-patterns","React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","https:\u002F\u002Fgithub.com\u002Fglows777\u002Fflux\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fvercel-composition-patterns\u002FSKILL.md",[155],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[157,158,120,43,159,138,133,160,140,48,161,162,163,36,164,147,165,166,38,167],"Composition","vercel composition patterns","composition patterns","architecture","component architecture","api","react composition","reusable","react 19","render","react composition patterns",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":176,"publishedAt":51},"01M6K5GB57GNNJJ1KV6TAQY8VT","ui-design-system","UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.","https:\u002F\u002Fgithub.com\u002Fglows777\u002Fflux\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fui-design-system\u002FSKILL.md",[174,175],{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[35,31,46,177,34,178,49,179,180,181,47,182,183,36,184,185,186,187,188,97],"ui design system","ui design","documentation","collaboration","toolkit","dev","developer handoff","visual","generation","ui designer","consistency","design token",{"skillNo":190,"name":191,"nameZh":6,"description":192,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":193,"categories":194,"keywords":195,"publishedAt":51},"01M6K5FZ0T5MF6XA47VDVF7N0K","ai-sdk","Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: \"AI SDK\", \"Vercel AI SDK\", \"generateText\", \"streamText\", \"add AI to my app\", \"build an agent\", \"tool calling\", \"structured output\", \"useChat\".","https:\u002F\u002Fgithub.com\u002Fglows777\u002Fflux\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fai-sdk\u002FSKILL.md",[],[196,197,198,199,133,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214],"sdk","ai sdk","google","ai agents","rag","openai","streaming","embeddings","Tools","Providers","text","ask","hooks","vercel ai sdk","app","structured output","add","my","features"]