The insanity of vendor prefixes

The web controversy du jour: Opera confirms WebKit prefix usage.

Many others have written wisely on why this does or doesn’t break the web. So let me put this more simply.

Many of the vendor proponents of having Opera (or Mozilla) use -webkit- prefixed CSS directives use the argument that, well, web developers are just lazy, and they are leaving off the prefixes for our browser, and thus users of our browser are not seeing websites in all their dazzling glossy glory, so we will solve that by aliasing -webkit-, fixing the problem created by those oh-so-lazy web developers.

But here’s the thing. Instead of just aliasing all the -webkit- prefixes, we will just do a select few. You should still use -o- prefixes for Opera on all the other properties!

And my take is, the problem is that these awful lazy web developers are not using -o- when vendor prefixes are involved, and now they are supposed to know to use -o- on some properties, but not for others?

That seems ill-considered.

The reverse is really true. My understanding is that the reason for aliasing these select properties is because they are so essential to the appearance of sites that they appear broken without them. So even if lazy developers don’t use -o-, but do use -webkit-, the website will still look shiny and glossy.

Vendor prefixes do have a very useful purpose. As a CSS property is being developed, it allows for different vendors to try out different implementations, until a syntax has been agreed upon. Then that new syntax is standardized in the unprefixed version.

Except for perhaps gradients, that is not how vendor prefixes are being used.

Instead, web developers are being told that some CSS3 properties are not yet standardized, because the standardization process appears to take forever and a day. So if you want to use these properties, dear developer, you must use a vendor prefixed version of that property.

But! You want that to look nice in every browser, don’t you? So please, dear developer, make sure you include prefixes for every major vendor. (Pssst, and if you have a domestic website with little to no global traffic, you should still include an -o- prefix, even though almost no local traffic uses Opera, because otherwise, you are lazy and a bad, bad developer.)

Oh! And you should also include the unprefixed version of this new, shiny CSS3 property. Because eventually, the property will be standardized. And then vendors will remove support for the prefixed versions.

So. What you should do, dear developer, is to write five lines of CSS saying exactly the same thing, because otherwise, you are lazy.

Oh, and most of the time you should write every single line exactly the same way, except sometimes, rarely, maybe you shouldn’t like with gradients.

Oh, yes, and it’s your responsibility to keep track of if there are any changes of syntax between all the vendors in any new versions, because otherwise, your site won’t look quite right. And that would make you lazy.

Oh, yes, and it’s your responsibility to keep track of all the proceedings of the W3C CSS Working Group to find out if they make alterations to the standardized versions of each CSS3 property. In a great deal of cases they don’t! But you must keep track of this, dear developer, lest your site become broken.

What? You don’t necessarily maintain the CSS of all sites you build for clients on a daily basis? It is a challenge to explain to clients why they should pay you to go back to their sites, and update the CSS to account for changes, so that their sites do not appear to be broken? Oh, they blame you for this? Well, why not just go back and do it for free? Because otherwise, you are just such a lazy, lazy developer.

Oh, I forgot to tell you, dear developer! If you want to escape this madness, here is our answer! Simply do not use any CSS3 properties that depend upon vendor prefixes. Wait 10 years or so for the W3C to standardize things. In the meantime, you can continue to use your old, clunky, semi-broken techniques. And oh yes, if you only use standardized CSS3 properties, and never use vendor prefixes, then those properties won’t work in older browsers that rely upon the vendor prefixed version.

But you should be able to work this out, dear developer. And if you do not, then clearly, it’s just because you’re lazy.

Like I said, vendor prefixes were a wonderful idea that addressed a real need. They have helped the web to move forward faster. But the way they are currently being used is, quite frankly, insane.

And perhaps, just perhaps, it is not terribly useful to call the developers contending with this madness, who you are relying upon to make websites look good in your browsers, lazy.

Do tools like LESS and SASS help make sense of the madness? Sure. But usage of CSS should not be dependent on those tools.

So what to do?

I think it’s time to move past vendor prefixes, and move towards versioned prefixes. I have written a couple posts on this. Here they are: