Moving away from Tailwind, and learning to structure my CSS
30 points by dzwdz
30 points by dzwdz
not sure if this opinion will be popular, but I don't typically use any css or javascript frameworks for my personal projects anymore. Can't have supply chain vulnerabilities if you have no dependencies! Of course that's only one type of vulnerability but it helps.
I'm also back to a fairly vanilla HTML/CSS/JS, sprinkled with hand-rolled stuff. It's a combination of framework fatigue, npm audit overload, and the fact that with LLMs I don't have to care anymore about what other people think about the implementation (eg. Why are you not using React and Tailwind?).
I mean, yeah — this is how CSS works. People not knowing this and blindly using Tailwind make me want to step outside and yell at clouds for a while. AFACT, 90% of Tailwind is just inline styles with different syntax — it's arguably just one step above <FONT> tags.
I’m not sure what your goals are with this comment, but I can say that in almost 8 years of using Tailwind I read a countless number of comments like this one dismissing Tailwind users and none of them helped me in any way to move off of it or to improve my CSS skills.
this blog post is me explaining what I actually needed to know.
AFACT, 90% of Tailwind is just inline styles with different syntax — it's arguably just one step above <FONT> tags.
That's not really very accurate, Tailwind behaves very differently to inline styles and much more similarly to CSS. As the author's article points out, a lot of the good habits that make Tailwind work well are the same good habits you need to write effective CSS. Tailwind is more like giving every element an implicit scoped CSS block, but with a funky DSL.
Your time spent yelling at clouds could be spent figuring what Tailwind is and how it works, then it might not make you so upset! ;)
As someone who hasn't really been following along, this seems like a pretty good peek into modern CSS practices. I really like all the links to her inspirations, they seem like good reading (but so far I've only read "no outer margin").
I am, however, a bit skeptical of the "bottom up" approach for base styles? Not that I know what else I would do (and it still seems worth a shot), base styles are just inherently finnicky.
I love this article. I also learned about CSS gradually over time by writing lots of random little sites, and I think that I would have benefited from thinking about these sorts of "systems" more from the beginning. I'm fairly allergic to frameworks but not using them meant that I often felt like I was floating in a bit of a structureless void even when I understood how to make everything work like I wanted.
I found this structuring technique very useful for organizing CSS: https://rstacruz.github.io/rscss/
It broadly agrees with and provides a bit more structure and organization on top of what jvns describes in OP.