News for hackers. Stuff that matters.
Re:Moving away from Tailwind, and learning to structure my CSS by efortis on Saturday May 16, 2026 @12:17PM (#48161514)
CSS Modules are a simpler solution to cascading problems. They create unique class names, so your classes don't clash [1]. And they don't have the two main downsides of TW, which are readability [2] and tooling. Tooling for debugging and experimenting interactively with Chrome and FireFox DevTools.

[1] https://x.com/efortis/status/1888304658080256099

[2] https://github.com/ericfortis/tailwind-eye

Re:Moving away from Tailwind, and learning to structure my CSS by culi on Saturday May 16, 2026 @10:08PM (#48165474)
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)

Re:Moving away from Tailwind, and learning to structure my CSS by efortis on Saturday May 16, 2026 @11:22PM (#48165787)
True, I didn't mean to omit other solutions, I thought styled-components were deprecated after React 18.
Re:Moving away from Tailwind, and learning to structure my CSS by madkat on Sunday May 17, 2026 @04:00PM (#48172691)
Yeah it was/is (doesn't work with server components). That's the reason we built next-yak (https://yak.js.org) as an alternative.
Re:Moving away from Tailwind, and learning to structure my CSS by culi on Sunday May 17, 2026 @04:04PM (#48172726)
Thanks 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?
Re:Moving away from Tailwind, and learning to structure my CSS by culi on Sunday May 17, 2026 @04:03PM (#48172721)
Yeah 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
Re:Moving away from Tailwind, and learning to structure my CSS by thisismyopinion on Sunday May 17, 2026 @06:04AM (#48167514)
We've for a while determined that unique class names are a dark pattern. Having to match unique and unreadable names with the actual src is a productivity killer.