Replies: 1 comment 4 replies
-
If you simply want to change the value of class or className with the value of You can also use tailwind-merge to create an extensible UI component. Good luck! 🍀 |
Beta Was this translation helpful? Give feedback.
4 replies
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.
-
Hello, I'm quite new, and I need some help.
Consider this use case: a monorepo with
app-a
andapp-b
.app-a
has colorprimary: "red"
in it'stailwind.config.js
app-b
has colorprimary: "blue"
in it'stailwind.config.js
ui
package, with, say,Button.tsx
component. This Button component hasvariant
prop with "app-a" and "app-b" available values.app-a
andapp-b
.My question is, how can this component change it's tailwind classes depending on the
variant
prop? Somehow I should import both tailwind configs, fromapp-a
andapp-b
in theui
and select one or another, depending on thevariant
value.Any ideas?..
Beta Was this translation helpful? Give feedback.
All reactions