The CSS Problem
Post from November 12, 2012 (↻ March 30, 2016), reflecting Jens the Developer.
This and many other posts are also available as a pretty, well-behaved e-book: On Web Development.
CSS is growing too large while CSS 2 has not nearly been understood by authors. This non-sustainable growth is a big problem for CSS.
What’s indicative of this problem? CSS 2 includes about 120 properties, but CSS 3 may drive this to more than 270. Then, authors make generous use of boilerplates and resets and variables (through LESS, SASS, or Closure Stylesheets), but they don’t even master selector grouping (seriously).
If I had one wish, the CSS Working Group focused only on critical features. If I had another one, the web developer community focused more on the optimal use of style sheets.
That is all I have to say about CSS these days. (Almost. I don’t publish much anymore, but if I do, I like to do it on Google+.)
About the Author
If you have any questions or concerns about what he writes, ask him to explain, or share your own position by sending a constructive comment or email. (Then, if you think something could be of interest to Jens, recommendations for excellent literature are always welcome.)
On November 13, 2012, 0:10 CET, BoltClock said:
CSS 2 includes about 120 properties
Heh… and authors think at least half of those properties are new to CSS3
Unfortunately, I guess this is one of those “unavoidable problems” that’s bound to plague a Web-based technology. I too wish we could give people a stronger foundation in the “base” CSS2, but realistically for the accelerated growth of the Web that’s simply not going to work. Plus new people are jumping on the bandwagon every day. The line is surely going to be blurred between CSS2 and CSS post-level-2 sooner or later.
I could list all the issues I’ve seen authors have with grasping CSS, but there would be too many and it would be a serious test of my patience just thinking about them! Let’s just say that the [css] and [css3] questions on Stack Overflow have been somewhat of a pain to keep in check (I’m a moderator and high-tier CSS answerer on SO)…
Too bad authors either don’t care for the optimal use of style sheets, or they have an extremely warped impression of the word “optimal” (c.f. CSS Lint). In the meantime, I’ll be fighting the good fight
On November 13, 2012, 0:16 CET, David Woolley said:
It is part of the natural history of standards that they start of simple and well targetted, but get bloated by the standardisation process, which tries to make them do everything.
Often, and this happened with HTML, but possibly not CSS, they start as a rejection of previous standards which have gone too far that way, but end up with the same fate. (I think HTML5 is everything that HTML 1 was trying not to be.)
Another aspect of this is that when things get too complicated, layers are put on top of them; I think that may be what is happening with LESS, etc., although I’m not sufficiently familiar with them. Often these layers end up emulating functions done a couple of layers lower down, because people have forgotten so much about what those sub-layer do.
I don’t see the problem. I don’t know what a “master selector grouping” is, nor probably do I care. If I needed to know that, then I’m sure I would have learned it (just like I should probably know how DNA works, but I don’t need to for my everyday work).
What I care about is being able to do my job with CSS. Restricting to CSS 2 doesn’t help there so it seems unhelpful to say “OMG CSS is too big and developers don’t know about obscure edge cases and inside-baseball jargon”… master selector grouping, seriously?
It’s also a good thing that developers are moving to using LESS, SASS, and whatever, as it points to the evolution of the platform (while exposing the failures of old CSS).
On November 13, 2012, 14:50 CET, David Woolley said:
“master” is a verb meaning “have (or gain) a thorough understanding of”. selectors are essentially what makes CSS CSS, and allows one to write style sheets that follow the structure of the document without having to categorise every element explicitly.
On November 13, 2012, 22:08 CET, Thierry said:
This knotty problem was indeed acknowledged by Daniel Glazman, co-chairman of the W3C CSS group. They acted as the HTML WG did : building too many modules and documents, some of them being far too complex. They spent so much time releasing all these modules and documents. As they were looking for a perfect model usable in all the possible cases entcountered in any situation, they, unfortunately, rejected simple, and sometimes really trivial, solutions, since they were working for “only” 99% of the World Wide Web. That’s a pity.