So, that's challenging. So, I'd say that those are the four main concepts we have.
And now, moving on to Atomic CSS, the core of this talk. So, I will try to do a good, bad and ugly approach here. But, if you're probably tired of listening to this multiple times, I wanna show you, I wanna do a different take here. And I'm gonna start by going through what I consider to be actually bad takes people have about Atomic CSS. And the first one is, they compare a lot with inline styles. But the thing is, first, inline styles are really costly for the browser, because it's just really costly to convert. The strings you have onto the style attribute and to native representation in the platform. And also, by adding those multiple styles, you are adding multiple reflows. Also, inline styles can't handle media queries, pseudo selectors, and other features you have. And one key point here is, mostly when you're doing inline styles, you're gonna have to follow preexisting definitions as you would have with utility classes, where you have a very well defined API, and those act as a single source of truth.
The other point we listen a lot of there is, it generates HTML bloat, and that's bad for performance. But, the thing is, we nowadays have a lot of compression algorithms, like GZIP, and we even have techniques made to handle duplicate strings like the deflated algorithm. And, I also drew another perspective in that. That is, the more a selector is repeated in the style sheet, actually the more work a browser has to do to resolve those styles. So, in that sense, semantics CSS and others could also be adding a bloat.
Then comes the concern of separation of consorts. And, a lot of people point that atomic CSS by definition break separation of consorts, but I think that we should kind of shift our view and see that the style composition is being performed in the HML, but you're not doing style align with the height, those attributes. Actually, what you have are just pieces from a style sheet that are assembled in the HML. So, the HML is kind of the consumer of the CSS you created. So, you have an API in that sense. And, also I think that this kind of represents this very extreme vision of what separation of consonants is all about. And, that's dangerous because that can lead to very impractical scenarios. And, this is even addressed, for example, in the Vue.js documentation where they point that a lot of people make a confusion between separation of consonants and separation of bio types, for example. And, in an analogous way, you have a bunch of other things like redesigning and faming becomes challenging or you end up with a lot of unused CSS or it's hard to use what's available, it's hard to know what's available there for you to use or even you have to learn a whole other language on top of CSS. And, the list is huge. Point is, I think that those are concerns kind of from, coming from the past. And, if we look at tail end and modern tooling we have in the scene of atomic CSS these days. We have the potential to alleviate most of those concerns and even get new benefits.
Comments