W3C home > Mailing lists > Public > www-style@w3.org > October 2008

Re: [Css Variables] Variable Declaration Blocks

From: Brad Kemper <brkemper.comcast@gmail.com>
Date: Sat, 18 Oct 2008 12:37:10 -0700
Cc: Mike Wilson <mikewse@hotmail.com>, 'Andrew Fedoniouk' <news@terrainformatica.com>, www-style@w3.org
Message-Id: <D2DB044D-B057-4369-A514-843E18579573@gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>


On Oct 18, 2008, at 7:21 AM, fantasai wrote:

>
> Mike Wilson wrote:
>> Andrew,
>>> We've found that natural constants first-seen-first-used approach
>>> works just well. For example:
>> You suggested the same thing back in June and it was discussed here:
>> http://www.nabble.com/WebKit-now-supports-CSS-Variables-td18076178i60.html#a
>> 18162114
>> or
>> http://lists.w3.org/Archives/Public/www-style/2008Jun/0351.html
>> ..
>> and I agree with the other posters at that time that it would be  
>> confusing to have "first rule overrides later rules" for variables/ 
>> constants when the rest of CSS uses "last rule overrides
>> earlier rules".
>
> I agree with that as well. If fallbacks are important, then we can
> define some syntax that explicitly says it's a fallback.
>
> @define fallback values {
>  foo: bar;
> }

Or perhaps:

/* override-able by later rules:  */
@define {
	foo: green;
	bar: 12px;
}

/* non-override-able by later rules:  */
@define constant {
	baz: orange;
	qux: 3em;
}

Constants are nearly as common in programming languages as variables,  
so the word "constant" is well known to mean that any subsequent  
attempts to assign new values to it later should fail. By the way, I  
don't find it confusing at all. Constants exist to be non-changeable  
by later statements, so if you call something a constant, its behavior  
in that respect is very clear.
Received on Saturday, 18 October 2008 19:37:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:15 GMT