Skip to content

Instantly share code, notes, and snippets.

@MantasMikal
Created August 2, 2023 19:17
Show Gist options
  • Save MantasMikal/283e1594edabcc3b5665ca11ada552a0 to your computer and use it in GitHub Desktop.
Save MantasMikal/283e1594edabcc3b5665ca11ada552a0 to your computer and use it in GitHub Desktop.
Tailwind merge + clsx
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