Created
August 2, 2023 19:17
-
-
Save MantasMikal/283e1594edabcc3b5665ca11ada552a0 to your computer and use it in GitHub Desktop.
Tailwind merge + clsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { twMerge } from "tailwind-merge"; | |
import { clsx, ClassValue } from "clsx"; | |
/** | |
* Inteligently merge tw classess with clsx concatination | |
**/ | |
export function cn(...inputs: ClassValue[]) { | |
return twMerge(clsx(inputs)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment