variantjs/core

Pass multiple variants to component

Closed this issue · 2 comments

jaulz commented

What do you think about passing multiple variants to a component? They could be separated by spaces (just like CSS classes) and then you could combine them as necessary, e.g. for a button: "icon sm", "primary lg" etc.

@jaulz the first version (vue-tailwind v0) was used to "combine" classes but after using it a lot of notice that it creates complex templates that are not easy to maintain, you need to think about a lot of stuff before combining classes especially in a complex component like the rich select.

Still not closed to the idea but I think is subject to a future version

HI, I have a similar question. In my mind I have a button with variants: "default", "outline" and "link" and each of this variant I need differnt colors and sizes. Can I solve that with variantjs? Or do I need a differnt component design?
If I use only variants for this it will lead a lot of variants. Thanks!