[css-variables] Examples

Regarding the latest CSS variables draft [1], I recommend to revisit
the examples, at least examples 3 and 4 [2], in order to build a
stronger case for when and how variables are actually useful. It may
be necessary to work with a lot more code to illustrate the usefulness
of variables.

Example 3 is a good example for the problem as there’s no benefit in
using variables here.

:root { color: blue; }
div { color: green; }
#alert { color: red; }

has the same effect, is shorter and more efficient, and a lot easier
to work with.


[1] http://www.w3.org/TR/2012/WD-css-variables-20120410/
[2] http://www.w3.org/TR/2012/WD-css-variables-20120410/#defining-variables

--
Jens O. Meiert
http://meiert.com/en/

Received on Monday, 30 April 2012 16:11:16 UTC