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

Re: WebKit now supports CSS Variables

From: Francois Remy <fremycompany_pub@yahoo.fr>
Date: Sun, 29 Jun 2008 23:09:15 +0200
Message-ID: <8A03B223C86A44FF9163733B08EA421E@FremyCompany1>
To: "Simetrical" <simetrical@gmail.com>, "Brad Kemper" <brkemper@comcast.net>
Cc: "Andrew Fedoniouk" <news@terrainformatica.com>, "Daniel Glazman" <daniel.glazman@disruptive-innovations.com>, "David Hyatt" <hyatt@apple.com>, "HÃ¥kon Wium Lie" <howcome@opera.com>, "www-style list" <www-style@w3.org>

> I know of multiple programming languages (Python, bash) with no
> concept of constants at all.  I know of none with no concept of
> variables.  Language-enforced constants are totally unnecessary for
> programming, and probably they only exist because in compiled
> languages they can be more easily optimized than variables which
> happen not to change.  None of the scenarios you've given have shown
> any benefit that I can see from unchangeable constants -- assuming
> that local stylesheets come after more global ones, which they
> generally do because of how CSS has worked to date.

I thouht we already have dicussed about it.
And the conclusion was that constants are not possible in CSS.

Why ?
> You can enable/disable stylesheet (by JavaScript, by changing the current 
> media, ...)

Consider this situation :

style1.css [enabled] {
    @const bgColor: red;
style2.css [disabled] {
    @const bgColor: green;
main.css [enabled] {
    body { background: const(bgColor); }

The body's background is red. OK.

In JScript, we can change the state of the style1.css and style2.css 
stylesheet. [enabled] <==> [disabled]
Now, bgColor has "green" as value.
==> bgColor has changed of value
====> This is not a constant, but a variable.

Received on Sunday, 29 June 2008 21:10:24 UTC

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