Replies: 1 comment
-
After trying many css solutions, I settled on this Solid-Styled as it allows proper css statements like styled-jsx but with the scoping working. In my opinion this type of css in jsx is more portable(copy n paste) from say css modules. As adding css to inline styles or to const vars is painstaking to transfer, say from react components with styled-jsx. Here's a guide for noobs as that's what I felt like, probably for good reason. Solid with SolidStyled CSS GuideInstall the latest SolidJS Framework Downgrade Vite or use "--force" on every install, Install Solid Styled and PostCSS Install the Vite Plugin Update the "vite.config.js" file
|
Beta Was this translation helpful? Give feedback.
-
Hey everyone, I'm new to SolidJS and am finding it, much easier to work with than react. But I'm having trouble using styled-jsx. It works fine, conditionals work, but there's no scoping. It affects nodes outside the component scope.
So I heard you can install Vercel's Styled-jsx, but keep running into issues like babelrc that does not exist with vite install. Do I create babelrc?
Anyway, if anyone can help me get "scoped Styed-jsx" to work, I would be very thankful to you.
Beta Was this translation helpful? Give feedback.
All reactions