Skip to content

Instantly share code, notes, and snippets.

@wKovacs64
Created January 17, 2023 01:39
Show Gist options
  • Save wKovacs64/7cb9084ea551b9a3bb07b98360c70908 to your computer and use it in GitHub Desktop.
Save wKovacs64/7cb9084ea551b9a3bb07b98360c70908 to your computer and use it in GitHub Desktop.
cn: wrapper around clsx and tailwind-merge
// Source: https://mobile.twitter.com/shadcn/status/1614692419039105024
import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: Array<ClassValue>) {
return twMerge(clsx(inputs));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment