the css of tomorrow

If you look at what css people write about, there are mainly two types of css articles you'll run into. One type is about bugs, how to fix stuff and workaround methods. The second type is about the future of css. What needs to be fixed, what is missing and where we are going. And once in a while you bump into an article that's basically a sobbing wail of css sorrows. I guess this article is a bit like that third kind of articles.

complaining

Complaining is a form of sanity control. It happens when you need to get something of your chest, and as a css guy you need quite a big chest already to carry all the weight. Apart from IE6 issues (let's say bad browser support in general), people usually like to complain about the slow innovation cycle of html and css. And rightfully so, css is very unlikely to answer to the geek/gadget dna many people in the IT sector hold.

It's not exactly the lack of new ideas or features that is responsible for this lack of innovation, but the immense backlog and serious backwards compatibility constraints that lie hidden within our job. We are still not freed from dinosaur browsers like IE6 and FF2 (who'd still want to use that one?), and until that time, all "new" tricks we use are likely to mess up our sites in those older browsers. It's something you learn to live with as a css developer, grasping at strands (like the new Opera 10 beta - which is nice and all, but does it really chance anything?) but it has a way of sneaking back at you at regular intervals.

A very typical complaint for web developers, but not really what I want to talk about today.

working to a new css future

I'm more worried about the development of css as a professional occupation. People seem so concerned with bugs, browser differences, new features and complaining about them, that they neglect the opportunity to make css a more mature and solid language. From time to time I like to roam around the web to take a look at other people's css. I will not deliver direct criticism here, but in my humble opinion the level of professionalism isn't all that high most of the time.

Even simple things, like structure and clean overview are unaccounted for. Most css files look as if 10 cssers whipped it together in one day trying to reach an insane deadline. Ten year old tag soup is easier to read than many a css file out there. There are no defined sections, css rules aren't logically grouped together and browser fixes are thrown in at the craziest places. Even if basic sections are presents, they are often messed up by people I assume joined at a later time and didn't help with the original css file.

And that's just form. The css itself is often a mess of unnecessary paddings/margins mix ups, filled with obsolete properties (remnants of quick experiments no doubt), badly thought out em/px use and the list goes on. Now, I understand that there is not one way to go about a problem in css, but the difference between method and lack of method is still painfully clear. Most people write css in a way that they go with what works. If it displays okay in browsers, they skip the cleanup process, afraid to break it again.

more, more, more

Sadly, the problem runs even deeper than bad css coding by css authors. I've been running into some structural css issue this last year (the implementation of rounded corners, the issue with sprites and most importantly, the lack of control over collapsing margins). I took the time and effort to participate in the w3 css mailing list, but the reactions were less than satisfying. From the time I've spent there I believe people are more interested in getting SVG graphics in css than solving core problems which are preventing css from becoming a solid, strong language.

It's not that I don't understand the need for innovation, but I fail to see how hard it is to understand that the lack of control over collapsing margins is already a very big issue today. It's very basic css issue that doesn't need 83 live examples to understand the seriousness of the problem, just a very simple sit-down to consider the (future) problems this obvious lack of control has and will have. And it's not that nobody is willing to listen, its just that they seem more preoccupied with other things. So unless you keep spamming and shouting for attention, a simple but crucial issue like this simply falls through the cracks.

conclusion

Bottom line: people seem unmoved by the fact that css is such a mess. Authors as well as developers just go with the flow, rather than make sure there's a solid base to work from. And unless that changes, I expect to keep seeing these chaotic, messed up css wreckages that support the visual presentation of sites in a browser. I believe it's time for more best practices, more core control and more structure. More people that consider the simple issues of css, like whether to use a margin or padding when both solutions are possible. Because there are always pros and cons, and with that preferred methods of working. And all that stuff about SVG graphics, css animation and rounded corners is cool,but not when I have to litter my css with overflow:hidden statements to keep margins from collapsing.

End complaint.