Recommended approach for component variants #18428
Unanswered
bd-cbasmajian
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm migrating from version 3 -> 4. What is the recommended approach for creating components with variants that minimizes code duplication?
For example, I have a base button class named
.btn
. I have variants that modify some properties, for example.btn-primary
and.btn-secondary
.In v3, I could use
@apply btn
in my variants, similar to the way sass uses@extend
.I do not want a solution that uses class lists in web or framework classes. I just want variants classes that are portable and can be used in any markup.
I do not want to use all css variables, too much code.
Should I still be using tailwind?
Beta Was this translation helpful? Give feedback.
All reactions