svelte + tailwind = joy
I really wish I had tried tailwind sooner. I don’t know that I “enjoyed” BEM, though it did make a certain sort of sense for giving stylesheets structure. Whole lot of naming things with BEM though, and that’s one of the hardest parts. It also introduces a lot of explicit connections between your stylesheets and your html. That’s a lot of different points to maintain. Tailwind on the other hand sees CSS rules as utilities, all the way down. A single class for a single rule. Thinking of CSS this way, it almost doesn’t matter how your html is structured. You might be thinking that sounds really clunky, putting so many more classnames in your HTML that you now have to keep track… and you kind of do, but you gain the freedom of not having to actually name anything at all. Plus all the styles for a thing are right there with the thing. If you do still need your own classes, you can still write CSS normally. The number of custom styles you need to write reduces drastically. And while tailwind generates a ton of classes in development, it also cleans them up to only keep the ones you actually use. Which keeps your CSS over the wire nice and tidy. The css for this site ultimately comes in at a couple of kB (57kB at the time of writing).