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

On Wed, 04 Apr 2012 19:36:38 +0200, Tab Atkins Jr. <jackalmage@gmail.com>  
wrote:

> On Tue, Apr 3, 2012 at 11:18 PM, Florian Rivoal <florianr@opera.com>  
> wrote:
>> On Tue, 03 Apr 2012 03:31:47 +0200, Tab Atkins Jr.  
>> <jackalmage@gmail.com>
>> wrote:
>>
>>> 2) Treat !important like normal, and have it effect the cascade (and
>>> not be part of the variable's value)
>>
>>
>> I think I like a non listed variant of 2: treat !important at the end  
>> of a
>> data- property normally. Any other !important in the data- property  
>> causes
>> properties into which it is expanded to be invalid.
>>
>> This is close to 2b, but different in this case for example:
>>
>> ul {
>>  data-foo: !important !important;
>>  data-bar: red;
>> }
>> li{
>>  background-color: data(bar) data(foo);
>> }
>
> It seems that it's only different from 2b if you're using the var
> property solely to pass data to JS, not to use in CSS.  Or am I
> missing something?

In the example above, the last !important of data-foo is used too make  
data-foo important, and the first one ends up being its value. When  
data-foo is expanded into background color, it puts !important at the end,  
and 2b says that we should ignore it when it is there.

I say that this should make the value of background-color invalid.

  - Florian

Received on Wednesday, 4 April 2012 17:46:29 UTC