Re: css constants

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 UTC