unocss-preset-shadcn icon indicating copy to clipboard operation
unocss-preset-shadcn copied to clipboard

[Suggestion] Remove clsx dependency

Open frandmb opened this issue 4 months ago • 0 comments

Clear and concise description of the problem

clsx is integrated into cva, the extra dependency can be removed

Suggested solution

replace

import type { ClassValue } from 'clsx'
import { clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs))
} 

with

import { cx } from 'class-variance-authority'
import type { ClassValue } from 'class-variance-authority/types'
import { twMerge } from 'tailwind-merge'

export function cn(...inputs: ClassValue[]) {
  return twMerge(cx(inputs))
}

on the README, and remove clsx from the list of dependencies

Alternative

No response

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

frandmb avatar Sep 25 '24 18:09 frandmb