Re: WebKit now supports CSS Variables

For some reason there was a problem with this message the first time,  
so I am trying again, with text-only.


On Jun 24, 2008, at 6:50 AM, Daniel Glazman wrote:

> The main purpose of CSS
> Variables for a corporation is unicity of design for all corporate
> web sites.

That's one reason for variables, but not the only reason. Other  
reasons match some of why you would use variables or constants in  
other programming languages:

1. So that long stretches of text do not have to be repeated. Anything  
that you have to type more than twice should be a candidate for  
variables, especially if it is long. This saves space, saves time  
editing, and reduces errors.

2. To make changes easier. When editing, a couple of small changes to  
the variable definition could ripple though all the rules that use it,  
without having to edit each of those rules. It avoids errors, saves  
times, and also allows for theming (in which a few changes to the  
variables creates new themes).

I proposed a syntax [1] prior to this one, in which I used "@constant"  
instead of "@variable", but it was more powerful than this one. In  
that one, you would also be able to have a single variable/constant  
represent a long stretch of selector text, or have it represent entire  
subsets of rules (multiple properties and values in one variable).

When this more limited version was published on disruptive- 
innovations.com, I was disappointed that it only dealt with singleton  
values for properties, and that it required a var() functional  
notation.  I really feel that an inferior syntax was chosen by Apple,  
simply because the spec was more fleshed out and detailed. Whoever  
writes detailed specs sees their choices implemented, regardless of  
discussions of better syntaxes on the list.

[1] http://lists.w3.org/Archives/Public/www-style/2008Feb/0102.html
http://lists.w3.org/Archives/Public/www-style/2008Feb/0112.html

Received on Wednesday, 25 June 2008 04:27:52 UTC