feat(utils): add utility function for class merging

A new utility function `cn` has been added to `utils.ts` for the purpose of class merging. This function uses "clsx" and "tailwind-merge" to merge class values, simplifying and optimizing the process of multiple class joining in our project.
This commit is contained in:
Mathis H (Avnyr) 2024-06-06 14:06:05 +02:00
parent 7910c5ef25
commit 4d6ae67389

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

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