diff --git a/packages/ui-web/src/lib/utils.test.ts b/packages/ui-web/src/lib/utils.test.ts deleted file mode 100644 index a9cfa41..0000000 --- a/packages/ui-web/src/lib/utils.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { buttonVariants } from "../components/ui/button"; -import { cn } from "./utils"; - -describe("cn", () => { - it("treats the ui type scale as font size, not color", () => { - expect(cn("text-primary-foreground", "text-ui-body")).toBe( - "text-primary-foreground text-ui-body", - ); - expect(cn("text-ui-body", "text-base")).toBe("text-base"); - }); - - it("keeps the variant label color on resized buttons", () => { - const classes = cn(buttonVariants({ size: "lg", className: "text-base" })).split(" "); - expect(classes).toContain("text-primary-foreground"); - expect(classes).toContain("text-base"); - expect(classes).not.toContain("text-ui-body"); - }); -}); diff --git a/packages/ui-web/src/lib/utils.ts b/packages/ui-web/src/lib/utils.ts index 88560bd..365058c 100644 --- a/packages/ui-web/src/lib/utils.ts +++ b/packages/ui-web/src/lib/utils.ts @@ -1,27 +1,5 @@ import { type ClassValue, clsx } from "clsx"; -import { extendTailwindMerge } from "tailwind-merge"; - -// The shared type scale (`text-ui-*`) is a font size, not a color. Without this, -// `text-ui-body` would replace `text-primary-foreground` and hide button labels. -const twMerge = extendTailwindMerge({ - extend: { - classGroups: { - "font-size": [ - { - text: [ - "ui-caption", - "ui-label", - "ui-body-sm", - "ui-body", - "ui-reading", - "ui-title-sm", - "ui-title", - ], - }, - ], - }, - }, -}); +import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));