W3C home > Mailing lists > Public > www-style@w3.org > April 2012

Re: [css-variables] Should var properties respect !important?

From: Chris Eppstein <chris@eppsteins.net>
Date: Fri, 6 Apr 2012 15:32:29 -0700
Message-ID: <CANyEp6X4yL2gofWoGAcLTDhv9LfNuSc_NsbgJpOi2JX79yMxmA@mail.gmail.com>
To: Florian Rivoal <florianr@opera.com>
Cc: www-style@w3.org
Is ! a legal value of a variable? Seems like it shouldn't be.

chris

On Fri, Apr 6, 2012 at 3:33 PM, Florian Rivoal <florianr@opera.com> wrote:

> On Thu, 05 Apr 2012 04:07:36 +0200, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>
>  Based on all the feedback, I think I'm going to go with (2a) - a
>> trailing !important in a var property affects the cascade in the
>> normal way, and is not recorded as part of the variable's value.  An
>> !important anywhere else in the var property is a syntax error.
>>
>> ~TJ
>>
>
> I still prefer 2d (same thing, except the syntax error is cause at the
> expansion of
> the variable rather than its definition) for two reasons:
>
> 1) It deals with this:
> ul{ data-foo:!;data-bar:important;**}
> li{ width: 0 data(foo) data(bar);}
>
> 2) you will have to parse the result of the expansion anyway, so it is a
> good time to detect syntax error. At the data-property definition stage,
> only lexing is needed, not parsing (except for the 2 last tokens, to see if
> they are "!" and "important"), which makes it at less natural place to do
> syntax checks.
>
>
Received on Friday, 6 April 2012 22:32:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:52 GMT