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

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