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

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

From: Florian Rivoal <florianr@opera.com>
Date: Sat, 07 Apr 2012 00:33:02 +0200
To: www-style@w3.org
Message-ID: <op.wcc7lcyh4p7avi@eeeflorian>
On Thu, 05 Apr 2012 04:07:36 +0200, Tab Atkins Jr. <jackalmage@gmail.com>  

> 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:28:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:14 UTC