Re: WebKit now supports CSS Variables

> 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