Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Remove clsx dependency #15

Open
3 tasks done
frandmb opened this issue Sep 25, 2024 · 0 comments
Open
3 tasks done

[Suggestion] Remove clsx dependency #15

frandmb opened this issue Sep 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@frandmb
Copy link
Contributor

frandmb commented Sep 25, 2024

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

@frandmb frandmb added the enhancement New feature or request label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant