nextui-org/tailwind-variants

Proposal: new syntax for boolean variants

GermanJablo opened this issue · 2 comments

I would like to propose the following:

// current
variants: {
   disabled: {
     true: 'opacity-50 bg-gray-500 pointer-events-none'
   }
 }

// proposal
variants: {
   disabled: 'opacity-50 bg-gray-500 pointer-events-none',
 }

This doesn't account for the false case. While the false case can be set as the default and rely on merging, co-locating true/false styles is very useful in many cases. I also don't think this provides enough additional value to warrant making it a first class concept given how complex tailwind-variants already is.

I understand.
I started playing with cva and tailwind-variants and whenever I've had a boolean variant I haven't needed to add styles for the "false" case, but I guess it makes sense in many cases.

Feel free to close the issue.