Replies: 1 comment 2 replies
-
I was about to post the same question. I liked the idea of how Mui for example has a variant (contained, outlined, ...) and separate color attribute. I tried reproducing it, but am stuck at how to solve the text color. Because of the specificity of how tailwind generates the order of colors, the following unfortunately doesn't work
If anyone has an idea :D |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Was wondering if it was possible to make variants of a button like 'filled' and 'outlined' support multiple colours.
Im currently structuring my cva by hardcoding all possible combinations which I feel like won't scale well (adding outline-primary, , outline-secondary):
Still quite new to tailwind land as I was previously using styled-components. I saw someone doing something like this using Compound Variants but it looked pretty messy in comparison to this...🫤
I was thinking of something a long lines of this:
But it quickly fails as setting primary='bg-any' would fail as soon as your try to do variant=outline (since there should be no background).
If there is a good way to do this or if this is the good way please let me know 😄
Beta Was this translation helpful? Give feedback.
All reactions