File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @zenml-io/react-component-library " : patch
3+ ---
4+
5+ provide custom ` twMerge ` utility
Original file line number Diff line number Diff line change 11import { clsx , type ClassValue } from "clsx" ;
2- import { twMerge } from "tailwind-merge" ;
2+ import { extendTailwindMerge } from "tailwind-merge" ;
3+
4+ const customTwMerge = extendTailwindMerge ( {
5+ classGroups : {
6+ fontSize : [
7+ "text-text-xs" ,
8+ "text-text-sm" ,
9+ "text-text-md" ,
10+ "text-text-lg" ,
11+ "text-text-xl" ,
12+ "text-display-xs" ,
13+ "text-display-sm" ,
14+ "text-display-md" ,
15+ "text-display-lg" ,
16+ "text-display-xl"
17+ ]
18+ }
19+ } ) ;
320
421/**
522 * Merges tailwind utilities, and allows the usage of the clsx syntax in addition
623 * @param inputs list of class names
724 * @returns
825 */
926export function cn ( ...inputs : ClassValue [ ] ) {
10- return twMerge ( clsx ( inputs ) ) ;
27+ return customTwMerge ( clsx ( inputs ) ) ;
1128}
You can’t perform that action at this time.
0 commit comments