{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "utils",
  "title": "Utilities",
  "description": "Utility function for merging Tailwind CSS classes with clsx and tailwind-merge.",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/lib/utils.ts",
      "content": "import { clsx, type ClassValue } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\n// The type-scale role utilities (see the size ladder in globals.css) are font sizes, but\n// tailwind-merge can't know that for custom classes — by default anything\n// text-<word> it doesn't recognize is treated as a text *color*, so\n// cn(\"text-body\", \"text-muted-foreground\") would silently drop the size.\nconst twMerge = extendTailwindMerge({\n  extend: {\n    classGroups: {\n      // EVERY role in the ladder has to be listed. One that is missing is not\n      // a styling nit: tailwind-merge classifies it as a colour, drops it\n      // against the `text-foreground` beside it, and the element falls back to\n      // preflight's `font-size: inherit` — 16px, which silently matches the\n      // prose role and hides the bug until a heading looks like body copy.\n      \"font-size\": [\n        \"text-display\",\n        \"text-heading\",\n        \"text-subheading\",\n        \"text-title\",\n        \"text-prose\",\n        \"text-subtitle\",\n        \"text-table\",\n        \"text-body\",\n        \"text-caption\",\n      ],\n    },\n  },\n});\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n",
      "type": "registry:lib"
    }
  ],
  "categories": [
    "lib"
  ],
  "type": "registry:lib"
}