My final conclusion about CSS is - program the damn machine.
What I mean by this is STOP every single type of abstraction/library/programming layer for CSS - nothing gets it right, everything causes a problem.
The ONLY way to deal with CSS is program it directly in the way the docs say, never anything else.
There's nothing wrong with using Bootstrap or whatever, and I definitely use JavaScript to program CSS. What I am saying is - no abstractions - no "better way" - no trying to turn CSS into something it isn't via whatever your new abstraction is that can be added to the N other abstractions that other people have made over the years.
Program the damn machine.
CSS suffers from one of its original design tenants in that it's very easy to throw some shit at the wall and kind of get it working without fully understanding it. This is especially true for people who have dabbled in it from time to time in their career when absolutely needed. It's rare to see someone sit down and learn it from first principles. It doesn't take long and knowing the basic theory goes a long ways!
The worst part is that inevitably the frameworks end up being harder to learn than CSS due to feature accretion
For me nothing beats plain old classes and an external css file. For PWAs I just use lit css within the element, again with classes and plain css. If things cause problems, just figure out why and fix the classes.
I've been ranting about this for years, even wrote a blog post[1] a few years ago whinging about it. Nice to see others share the same sensibility
1: https://pdx.su/blog/2023-07-26-tailwind-and-the-death-of-cra...
This is exactly how I feel. Learn how to write CSS! Like you would do with any language!
I've loved tailwind for the colocation of the component HTML and its corresponding styling (never gave up on traditional CSS though!), but with scoped styles I might start leaning back to traditional CSS.
I mean... sure, just tell me how to write a fully responsive landing page straight from a PSD file by the marketing dept in roughly less than an hour without using Bootstrap or, for goodness sake, Tailwind and I'm ready to drop any framework and write "bare metal" (Ah!) CSS.
I'd also like if anyone could look at the specifications for CSS, ideally for Grid, especially the `grid-template-*` and `grid-auto-*` subset of rules, mixmaxing and gotchas and tell me what CSS exactly is right now, So I can avoid turning it into something that is not.
The only way to deal with a poorly designed system is NOT giving up, but engineering your way out of it
Also: web layouts are meant to look different on different screens. I had to program my own layouts from scratch for embedded devices and games before. And that occasionally made me wish for CSS.
CSS is fine. Most people just never learned it.
Yes. It’s been twenty years of watching people pick an fussy framework because they don’t want to learn the tool, then struggle to get the results they want because the framework is flawed but they didn’t learn enough to understand how and when to fight it.
And with grid, variables, animation, container queries, modern CSS is amazing. You just need to treat it with a little respect.