Table of contents
Recently, I found myself a bit of disgusting regarding CSS, which has being my favorite front-end language, and I didn’t know why, but finally the reason pop up.
These times are very exciting for those whom work with CSS because from some years ago until today, we have received many util tools, enough for being able to build modern, good-looking and more complex designs.
In earlier years, we have to use weird side effects caused by some properties to build our interfaces but today we have a vast amount of specifications, always moving forward, with many properties and functions, planned at its conception to resolve concrete difficulties we encountered.
The evolution were kind for us because there were many voices that claimed for new specific tools, the CSS Working Group (under the W3C matrix) was integrated by professionals with the same needs, so they could push harder some petitions or suggestions, and in addition, anyone from the community could (and still) collaborate making some proposals. Furthermore, web browsers were doing its market war, trying to conquer more users, so they used to implement experimental features, which finally resulted in more allies to its gang.
CSS grew a lot in a short period of time. Today we have a large catalogue of properties, this is good, but I don’t feel happy.
I guess that it is because the richer the language is the harder to get to know in depth, and this situation ends up with a lack of familiarity, but if you think twice, it is not important because the good developer is able to understand what needs and where to find it instead of memorizing, thus, this is only a human feeling, not a strong argument.
Some days ago I was talking with my mates from Redradix about PostCSS, and I argued that before getting started, before configure your tool, you need to know what do you need. You have to know the weakest points of the language and what specifications are still in the draft, and at the same time the available plugins for PostCSS in order to set a util tool. I mean, you have to know what CSS doesn’t currently give to you but you “need”. Get to know how the language could be better and go beyond nesting to avoid re-writing a tool like SASS, because you already have SASS. The more difficult part is imagining that gap and fill it because today it seems that everything is invented.
A simple tasks a bunch of years ago because everything was needed, but not today. The capabilities of CSS are so vast, and it is still under development. New specifications are coming soon to resolve known issues (remember that developers from all around the world are part of the CSS WG).
Real life problems
Container queries, styles queries… I understand why they are here, but, do we really need them? It is not a huge research but asking my colleagues how many times they had to use it, how many times “they realized” they need it, and the answer was zero. Never. In my experience, I only remember once, back on 2017. After that, no more.
But it was supposed that these tools will resolve today’s real problems.
The old-fashion times have gone. Today we are not at the tail, we are ahead, maybe even too ahead, and we can’t see, in practice, how they will help us, because it is though to foresee farther than the examples that decorate the proposal. Perhaps they don’t resolve real problems because other areas (UX, UI) are not able to re-invent the way we consume the web, or at least, to get profit of this new features. Or maybe because they are not useful for today’s problems.
Then, I read the great article at smashing magazine about the (possible) future of CSS, and I couldn’t understand if I was afraid or excited, because I find the separation of concerns between the front-end languages (HTML, CSS and JS) even narrower. Almost deleted. And personally, I don’t like it although the amazing new features.
So I ended up with this feeling, but I didn’t get the words. Anyway, after talking with my mates and also reading this article at css-tricks I could spit all this out and understood that maybe I am not alone.
Obviously I do not want CSS to stop its development, it’s being amazing days to work as a front-end, but I wish everything continues with sense. I don’t have to mention that I can’t, neither I pretend to have more vision that the incredible people whom work hard to shape these specifications, but I wonder if there isn’t a shinny star that let them blind or someone pushes them to twist the bounds of CSS.
I will continue thinking about this topic, in the meantime I wait with illusion the full support for
:has() or maybe something that pops up like
grid-template-gap for setting asymmetric gaps.