feat(utils): add utility function for class merging

Introduced `cn` function leveraging `clsx` and `twMerge` to merge class names. This utility simplifies handling of conditional class names with Tailwind CSS.
This commit is contained in:
Mathis H (Avnyr) 2024-09-27 11:56:34 +02:00
parent f982d076a7
commit 9b2a86d887
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

6
src/lib/utils.ts Normal file
View File

@ -0,0 +1,6 @@
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}