feat: register custom text sizes and radii with tailwind-merge
This commit is contained in:
parent
a74a2c6200
commit
a7091c126a
@ -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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user