Add Interpolation classes that come from props #425
-
Hi, I would like to add tailwind classes that come from a component's prop. For example:
and the
I'm looking into this page #393 but is there anyway to avoid hardcoding the classes as suggested.
Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hey there In babel, twin is unable to grab the value of the tailwind classes passed in. const possibleTagColors = {
'bg-indigo-100': tw`bg-indigo-100`
}
possibleTagColors[tags.bgcolor] || 'black' |
Beta Was this translation helpful? Give feedback.
Hey there
In babel, twin is unable to grab the value of the tailwind classes passed in.
Unfortunately, this means you'll need to construct a color map to get the css values: