Re: WebKit now supports CSS Variables

Is there any use case for CSS variables to be mutable (not constants)?

As far as I can see the only difference from CSS constants ( 
http://csswg.inkedblade.net/ideas/constants )
is the ability to change values in runtime (from script).  So is the 
question above.

There is clearly a need for such thing as CSS vars/consts, but 
particular model (vars vs. consts) is still debatable.
At least for me. CSS consts as parse time entities allow to define 
shortcut attributes too, btw.

On other side if we already on the way of moving CSS declarations from 
static form to something that is getting
evaluated at runtime (early birds: MQ, calc()) then CSS-vars fit the 
model. As a logical corollary I think it will be some
sort of dynamic (behavioral?) extensions of  CSS that will allow to 
manipulate values of variables:

select#color-preferences
{
   on-value-changed! : var(theme-back-color) = #ff0000,
                                  var(theme-back-image) =  
url(red-back.jpg);
}

(That is CSSS! - http://terrainformatica.com/htmlayout/csss!.htm )

I mean that: if we say "A" (variables in CSS) then we should be ready to 
pronounce "B"
( some sort of dynamic [sub-]language in CSS ). Otherwise CSS-vars as 
mutable entities
appears as overkill if to compare them with @const.

--
Andrew Fedoniouk.
http://terrainformatica.com

Received on Tuesday, 24 June 2008 19:35:18 UTC