bradlc / babel-plugin-tailwind-components

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

When trying to use negative styles, the version evaluated in production builds is not correct. #57

Open mw999 opened 4 years ago

mw999 commented 4 years ago

For example with the following code:

const Container = styled.div`
  ${tw`-m-4`}
`

This would evaluate in development development to this:

"marginTop": "-" + _tailwind32.default.negativeMargin["4"]

However in production, it created

"marginTop": "\"-\"+1rem"

Here is chrome not liking the built style in prod

image

mw999 commented 4 years ago

Have submitted a PR here: https://github.com/bradlc/babel-plugin-tailwind-components/pull/56