Skip to content

Instantly share code, notes, and snippets.

@alamenai
Created September 17, 2023 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alamenai/e7b6abee3ed0c7e21e937acb5a86b48d to your computer and use it in GitHub Desktop.
Save alamenai/e7b6abee3ed0c7e21e937acb5a86b48d to your computer and use it in GitHub Desktop.
TailwinCSS merge and conditonal styling.
import { clsx, ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export const 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