by prmph · 1mo ago · 0 comments
CSS is one of the worst (web) technologies, breaking the very concept of composability, a core technique of complexity management. It also has all sorts of constructs trying to replicate the features of a proper programming language. Rampant use of CSS is an architectural smell.
And yet people will defend it to death. Every large project I have inherited has massive CSS files filled with hairy rules, utterly unmaintainable despite whatever people will tell you.
In my own projects now, large or small, I refuse to use CSS broadly. Except for a few global styles in a single small CSS file, I use inline styles for pretty much everything, combines with other code in a neatly composable components. This works very well.
Sorry for my strong opinions, but in my view the over-reliance on CSS and amount of work on it has held back the web from being what it really can be for rich apps. What we should be aiming for is to build in rich and very customizable components right into HTML with real-world sophistication. And allow websites to be installed as apps easily. These alone will do more for the web that all these CSS band-aids.
Inline styles are CSS. It sounds like you find components easier to compose when their CSS is applied directly to elements rather than via selectors, which is totally reasonable. But doesn't that undercut the broader claim that CSS itself somehow inherently breaks composability?
Sounds like a very good reason to work on css features to make it simpler to use