mirror of
https://github.com/logos-co/logos-web.git
synced 2026-08-30 21:51:09 +00:00
19 lines
659 B
TypeScript
19 lines
659 B
TypeScript
/**
|
|
* Conventional Tailwind className composer.
|
|
*
|
|
* Pipes `clsx` (conditional / falsy-aware joining) into `tailwind-merge`
|
|
* (resolves Tailwind class conflicts deterministically), so callers don't have
|
|
* to worry about precedence when overriding utility classes:
|
|
*
|
|
* cn('p-4 text-sm', condition && 'text-base', userClassName)
|
|
*
|
|
* Prefer this over template-literal interpolation everywhere a component
|
|
* accepts an external `className` prop or composes utility classes.
|
|
*/
|
|
import clsx, { type ClassValue } from 'clsx'
|
|
import { twMerge } from 'tailwind-merge'
|
|
|
|
export function cn(...inputs: ClassValue[]): string {
|
|
return twMerge(clsx(inputs))
|
|
}
|