Importing tw in all components #182
-
Hi! I was wondering if there is a way/plan to not have to import I think it would be pretty cool to have built in Was that discussed before? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Heya William 👋 I don't have any plans to avoid the 'twin.macro' import completely (like a vanilla babel plugin). import 'twin.macro'
const InputWithTwProp = () => <input tw="border hover:border-black" /> If you ever use styled-components instead of emotion, you'll also need to make sure |
Beta Was this translation helpful? Give feedback.
-
Hey, they just released a npm Babel plugin for twin! |
Beta Was this translation helpful? Give feedback.
Heya William 👋
I don't have any plans to avoid the 'twin.macro' import completely (like a vanilla babel plugin).
But you can currently use the
tw
(andcss
) prop by just importing the library like this:If you ever use styled-components instead of emotion, you'll also need to make sure
"autoCssProp": true,
is in your twin config.