goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.22k stars 133 forks source link

RFC: separate color and variant #154

Closed PeS82 closed 6 months ago

PeS82 commented 6 months ago

Which scope/s are relevant/related to the feature request?

button

Information

Stumbled upon this lib a few days back and I like the way it seems to be heading.

What struck me as odd is that colors are mixed up with variants. It would make sense (to me) to separate colors (primary, secondary, destructive, ...) and the actual look (flat aka default, link, ghost...).

The way it currently is one can't render secondary ghost or link for example.

I took the variants from button as an example but this could be applicable to plenty of components that would have unifying attribute color (or style or theme or whatever) and variants (if any) separated.

I could try to make a PR for button if you agree and let's see how that goes.

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

goetzrobin commented 6 months ago

I think we will stick with the same implementation as shadcn for now. The idea is that you have a primary and secondary color and your variants are restrained to that. However, as spartan/ui copies the source code to your project you can always change the hlmBtn code to add a color variant. I am pretty confident the code will remain stable so you won't have to reinstall (and therefore lose existing changes) anytime soon!