W3C home > Mailing lists > Public > www-style@w3.org > March 2010

Suggestion for generic CSS vendor prefix

From: Xavier Mouton-Dubosc <xaviermd@gmail.com>
Date: Sun, 21 Mar 2010 23:22:31 +0100
Message-ID: <4BA69C27.1050909@gmail.com>
To: www-style@w3.org
I wrote this by recommendation from Daniel Glazman. I hope you will 
excuse my French : this is the first time I do this kind of contribution.

Problem :

Lot of properties are still in the infancy of the validation, other ones 
are waiting for the definitive approval of the CSS standard 2.1 or 3. So 
if you want to use an experimental property, each declaration should 
have the vendor prefix, with all the problems :

-moz-box-shadow: #f00 0 0px 2px;
-webkit-box-shadow: #f00 0 0px 2px;

Here, you can see that I completely forgot browsers like MSIE, Opera or 
Konqueror. A more complete example would be :

-moz-box-shadow: #f00 0 0px 2px;
-webkit-box-shadow: #f00 0 0px 2px;
-opera-box-shadow: #f00 0 0px 2px;
-ms-box-shadow: #f00 0 0px 2px;
-khtml-box-shadow: #f00 0 0px 2px;

But if I wish to write my own browser and implement those properties, my 
browser will always be forgotten wy CSS writers.
The other problems is the bloating of the CSS for every declaration, and 
stability in the future.

Proposal :

Using a wildcard like a star to explain that the experimental property 
is common to every browser that can understand it :

-*-box-shadow: #f00 0 0px 2px;

If the star is a problem to parse, another suggestion is to prefix with 
two hyphens, a little bit like an unix parameter :

--box-shadow: #f00 0 0px 2px;

Main advantage is browser neutrality, simplicity in the CSS and 
portability. And we can still target a kind of browser by its vendor-prefix.

Thank you for reading me.

A more complete page in French is on my blog : 

da scritch com works <http://dascritch.com/>

*Xavier Mouton-Dubosc*
Développeur web freelance <http://dascritch.com>

Received on Monday, 22 March 2010 14:41:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:33 UTC