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

Re: WebKit now supports CSS Variables

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Sun, 29 Jun 2008 22:16:54 -0700
Message-ID: <48686C46.7070609@terrainformatica.com>
To: Simetrical <simetrical@gmail.com>
CC: Brad Kemper <brkemper@comcast.net>, 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>

Simetrical wrote:
...
> There *should be* nothing in software default CSS that admins
> of a specific installation can't change.  Likewise, there *should be*
> nothing in a site-wide stylesheet that a particular section can't
> change.  Constants give flexibility where you *don't* need or want it,
> in the highest and most general layers, and take it away where you do,
> at the most specific level.

I am not sure I understand your concerns.

"admins" will be the first people who will benefit from @const.

They will define constants. Developers will use them.
Constants cannot be overwritten. So "admins" can sleep calmly.

In CSS you can overwrite everything. Already.
@const gives CSS new feature - ability to define
things that cannot be overwritten. So you have
more choices: you can use constness and/or you can use variability.
That in principle creates more design possibilities including
modularity through parametrization.

...

> 
>> For @conts, there is a big benefit of NOT
>> allowing any stop along the line to change the values. It is the same reason
>> programmers sometimes use constants instead of variables, and why they are
>> usually at the beginning of the program code.
> 
> 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.
> 

And I know programming languages that support modularity so
have constants. One of them is a next version of JavaScript:
http://www.ecmascript.org/es4/spec/overview.pdf by the way.

And by the way you should refresh your Python knowledge.
You can define immutable class attribute that is exactly 'const'
or 'final' if you know Java.

-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Monday, 30 June 2008 05:17:47 GMT

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