nextui-org / tailwind-variants

🦄 Tailwindcss first-class variant API
https://tailwind-variants.org
MIT License
2.42k stars 68 forks source link

`tailwind-merge` as opt-in instead of opt-out? #208

Closed datner closed 4 months ago

datner commented 4 months ago

Hey! I was considering using this library over cva but had noticed that tailwind-merge is supposedly baked-in?

tailwind-merge is great, but I don't need it or want it as it comes with quite a bit of overhead and interesting behavior. I know I can turn it off, which is great!!! But I would still bundle it in.

Would it be possible to remove the dependency on tailwind-merge and instead accept an optional merge-resolver from the outside?

import { twMerge } from "tailwind-merge"
const tv = createTV({
  mergeFn: twMerge
  // ...
});

It would remove the need to drill in the configuration as well, removing twMergeConfig from the interface...

I know it's a big change in the sense that it's user-facing, but if it's acceptable I can open a PR for it

mskelton commented 4 months ago

This would be very breaking for the library given that createTV is not the primary way tailwind-variants is used. Going to close as not planned.