Files
collabry-components/src/lib/cn.ts
T
2026-11-04 22:31:12 +01:00

18 lines
601 B
TypeScript

import { clsx, type ClassValue } from 'clsx';
import { extendTailwindMerge } from 'tailwind-merge';
// Teach tailwind-merge the custom font-size and shadow scales, so `text-sm` vs
// `text-fg-muted` and `shadow-focus` vs `shadow-xs` resolve as intended.
const twMerge = extendTailwindMerge({
extend: {
theme: {
text: ['2xs', 'md', 'display', 'hero'],
shadow: ['popover', 'menu', 'dropdown', 'dialog', 'toast', 'seg', 'bevel', 'nav-active', 'focus', 'side', 'primary', 'primary-flat'],
},
},
});
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}