W3C home > Mailing lists > Public > www-style@w3.org > August 2007

Re: css constants

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Tue, 28 Aug 2007 11:15:52 +0200
Message-ID: <46D3E7C8.3080600@disruptive-innovations.com>
To: Andrew Fedoniouk <news@terrainformatica.com>
Cc: fantasai <fantasai.lists@inkedblade.net>, www-style@w3.org

Andrew Fedoniouk wrote:

> Why "only if .. can be changed"? Could you explain real world scenario?

Sure. Imagine the following sheet, based on hypothetical @const
at-rule and a const() function notation.

    @const mycolor #123456;

    h1 { background-color: const(mycolor); }

    #foobar { color: #123456 ; }

    div.foo > p + h2 { border: solid thin const(mycolor) ; }

Now, when the page is loaded, you want to change programmatically
the constant into something else. Then OF COURSE you want the first
and last rule to be updated and NOT the second one. So what you
really want to tweak here is NOT the style rules themselves BUT
the @const definition. See what I mean ?
If you don't do that, having constants in CSS is mostly pointless
and only a minor help at authoring time.

</Daniel>
Received on Tuesday, 28 August 2007 09:16:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:52 GMT