bradlc / babel-plugin-tailwind-components

Use Tailwind with any CSS-in-JS library
MIT License
332 stars 25 forks source link

How to pass variables in? #19

Closed pkrogel-kws closed 5 years ago

pkrogel-kws commented 5 years ago

Is there any way to pass variables in?

I know this isn't correct, but something like:

const Button = styled('button')`
  ${props=> tw`font-mono text-sm text-${props.textColor} hover:text-${props.textColorHover}`};
`
joeldbirch commented 5 years ago

Same question. I guess you found an answer for this. May I ask what it was, please?

muhghazaliakbar commented 5 years ago

@pkrogel-kws Did you found the solution?

bradlc commented 5 years ago

The plugin doesn't support class name interpolation. e.g. text-${props.foo}

joulse commented 5 years ago

Hey @bradlc 👋, I'm very interested! Is't planned to support class name interpolation one day?