Line data Source code
1 : import { clsx } from 'clsx'
2 : import type { ClassArray } from 'clsx'
3 : import { extendTailwindMerge } from 'tailwind-merge'
4 :
5 : export type { ClassValue } from 'clsx'
6 :
7 2356 : const twMerge = extendTailwindMerge({
8 : extend: {
9 : classGroups: {
10 : 'font-size': ['text-xxs', 'text-xxxs'],
11 : // tailwind-merge does not know Tailwind's `max-h-none`, so it never
12 : // resolves conflicts like `max-h-[80vh] max-h-none` (both survive).
13 : 'max-h': [{ 'max-h': ['none'] }]
14 : }
15 : }
16 : })
17 :
18 2303101 : export function cn(...inputs: ClassArray) {
19 2303101 : return twMerge(clsx(inputs))
20 : }
|