How to embed any Tailwind class #754
-
I have just started playing with the Twin / Tailwind / Styled Components, and I am trying to understand how can I pass any Tailwind utility classes to a Styled Component, in TypeScript. My component looks like this
And the Styled Component like this
As you can imagine, the problem is in Am I even on the right path? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Twin doesn't support dynamic classes like you've found here. Try something like this: <Title $primary={false} $extraTailwindClasses={tw`font-large`}> Then twin can do the conversion and the css object is supplied to styled components. |
Beta Was this translation helpful? Give feedback.
Twin doesn't support dynamic classes like you've found here.
Try something like this:
Then twin can do the conversion and the css object is supplied to styled components.