W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: CSS Variables Draft Proposal

From: Alan Gresley <alan@css-class.com>
Date: Sat, 12 Feb 2011 14:02:18 +1100
Message-ID: <4D55F83A.4090409@css-class.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Colt Antonio Pini <Colt.Pini@nau.edu>, "Linss, Peter" <peter.linss@hp.com>, Alex Robinson <css-discuss@alex.fu2k.org>, "L. David Baron" <dbaron@dbaron.org>, www-style list <www-style@w3.org>, Daniel Glazman <daniel.glazman@disruptive-innovations.com>
On 12/02/2011 6:03 AM, Tab Atkins Jr. wrote:
> On Fri, Feb 11, 2011 at 10:22 AM, Alan Gresley<alan@css-class.com>  wrote:
>> Tab, there are two types of @rules that I know of that end with a semicolon
>> ';'. They are @import and @namespace, one of which must be quoted and the
>> other having parenthesis.
>>   @namespace foo "http://example.org";
>>   @import("example.css");
> Both of those involve URLs, which have their own host of issues.  They
> don't necessarily generalize to other types of things.

Precisely, they are URLs. They are not values that set values elsewhere 
in the CSS or even the CSS in another stylesheet.

>> Your proposal is requiring this to change plus the syntax rules of CSS. I
>> fine now with seeing the '$' in between a declaration block for a variable
>> value but what I liked about glazou's proposal was how the variable was set
>> and had '{' '}' to show the full declaration. Doesn't something like this
>> delimit the nature of a string?
>> @var foo {
>>    <property>:<value>
>> }
> No, "@var foo<value>;" is exactly equivalent in terms of delimiting.
> ~TJ

No it is not. Recently in this thread I saw this.

>> Do we really want that?
>> How about:
>> @var $foo url(;
>> @var $bar );
>> p { content: $foo http://example.com/yikes.gif $bar }
> Oh jeezus no.  I don't know the precise details of url() parsing, but
> either that is parsed into a single $foo variable containing
> "url(;\n@var $bar )", or they're both invalid.  Either way works for
> me.

Either way works. How does "url(;\n@var $bar )" work? What would happen 
if we had url() parsing in blocks with curly braces?

@var $foo {
@var $bar {

Is this valid or does this get parse in a string as "url( } @var $bar { 
)"? What is left is just this.

@var $foo {


I know that both examples would get thrown out. The first because it is 
not a fully formed value for foo and bar. The second "url( } @var $bar { 
)" because it has incorrect opening and closing curly braces.

Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Saturday, 12 February 2011 03:02:55 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:56 UTC