W3C home > Mailing lists > Public > www-style@w3.org > September 2008

Re: [Css Variables] Variable Declaration Blocks

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 24 Sep 2008 23:12:32 -0700
Message-ID: <48DB2BD0.3040700@terrainformatica.com>
To: Mike Wilson <mikewse@hotmail.com>
CC: www-style@w3.org

Mike Wilson wrote:
> Andrew,
>> We've found that natural constants first-seen-first-used approach
>> works just well. For example:
> You suggested the same thing back in June and it was discussed here:
> http://www.nabble.com/WebKit-now-supports-CSS-Variables-td18076178i60.html#a
> 18162114
> or
> http://lists.w3.org/Archives/Public/www-style/2008Jun/0351.html
> ...
> and I agree with the other posters at that time that it would be 
> confusing to have "first rule overrides later rules" for 
> variables/constants when the rest of CSS uses "last rule overrides
> earlier rules".

Beg my pardon but that "last rule overrides earlier rules" of
yours is simply not correct in terms of CSS.

You can put very specific rule upfront that will not be overwritten
by later rules.

Consider very first @const with the same name as having largest
possible specificity. That is it. Authors already familiar with
the concept.

first-seen-first-used rule for constants:

1) makes them extremely simple to
    a) define in the spec;
    b) implement in UA;
    so expect reliable and uniform implementations.

2) gives CSS another axis of flexibility:
    you can create master configuration CSS file for the
    whole site and *guarantee* that values defined there will be used
    across all imported CSS files - will not be redefined by accident
    or possible name conflicts if your styles are coming from different

Consider that you have some advertisement block on your site
that defines its own styles and constants. Its inclusion may ruin
your system of constants that your carefully crafted.

If @const is const then it is enough for you to include your CSS 
parameters as the very first item and it will work for all subblocks
of your page in the very same way.

Andrew Fedoniouk.

Received on Thursday, 25 September 2008 06:13:00 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:39 UTC