3 ms·
Don't most modern CSS tools create unique class names? I know styled-components did. Recently I've been using linaria which is a drop-in replacement for styled
by culi 5mo ago
Don't most modern CSS tools create unique class names? I know styled-components did.
Recently I've been using linaria which is a drop-in replacement for styled-components (exact same API) but its zero runtime. All the CSS is compiled during build (similar to vanilla extract, panda CSS, etc).
I really prefer things like styled-components or Linaria or CSS Modules where you can just write straight up CSS. If you ever decide to switch your tool you should always be able to just copy-paste your CSS away. You don't get that with Tailwind or "styles-as-objects" stuff (StyleX)
- efortis 5mo agoTrue, I didn't mean to omit other solutions, I thought styled-components were deprecated after React 18.
- madkat 5mo agoYeah it was/is (doesn't work with server components). That's the reason we built next-yak (https://yak.js.org https://yak.js.org) as an alternative.
- culi 5mo agoThanks for your work on Yak. When I was evaluating the alternatives to styled-components, I went with Linaria over next-yak because it is zero runtime. Any plans for Yak to support this as well?
- culi 5mo agoYeah they are not supporting server components. That's why I said I used Linaria which is a drop-in replacement. Exact same API so any team can simply run a codemod tool to change the import rule from styled-components to linaria