diff --git a/app/lib/utils.ts b/app/lib/utils.ts index 3877c89..260862c 100644 --- a/app/lib/utils.ts +++ b/app/lib/utils.ts @@ -1,5 +1,16 @@ import { clsx, type ClassValue } from 'clsx'; -import { twMerge } from 'tailwind-merge'; +import { extendTailwindMerge } from 'tailwind-merge'; + +// Teach tailwind-merge the custom @theme sizes and radii in app.css, so e.g. `text-display` +// is treated as a font size (not dropped as a colour) and radius overrides replace each other +const twMerge = extendTailwindMerge({ + extend: { + theme: { + text: ['3xs', '2xs', 'md', 'display'], + radius: ['chip', 'option', 'item', 'control', 'group', 'field', 'card-sm', 'card', 'panel', 'phone', 'phone-screen'], + }, + }, +}); export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));