Styled components and integrating with vite's react plugin #578
-
Hello, I'm looking at the example for vite and it looks like it's using https://www.npmjs.com/package/@vitejs/plugin-react-refresh. When initalizing a new vite project it comes with https://www.npmjs.com/package/@vitejs/plugin-react, and I can't seem to use that with twin.macro. I'm not too familiar with bundlers/build tools, and I was hoping I could get some clarification onto what's going on behind the scenes? I'd like to be able to use the new vite plugin so that I wouldn't have to import react in my app. EDIT: it looks it's just been updated! Thanks for the update :) It'd still be very helpful to understand what is happening under the hood (for what was happening before), and what resources I can use to look into this further. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hey there, great you saw I just updated the styled components + vite example. I still need to update the remaining next examples too. Here's the section from the readme that explains how twin works:
import tw from 'twin.macro'
tw`text-sm md:text-lg`
// ↓ ↓ ↓ ↓ ↓ ↓
{
fontSize: '0.875rem',
'@media (min-width: 768px)': {
fontSize: '1.125rem',
},
} Did you have any questions on top of this? |
Beta Was this translation helpful? Give feedback.
Hey there, great you saw I just updated the styled components + vite example. I still need to update the remaining next examples too.
Here's the section from the readme that explains how twin works:
Did you have any questions on top of this?