Re: CSS Variables

On Sun, Feb 6, 2011 at 4:16 AM, Jon Rimmer <jon.rimmer@gmail.com> wrote:
> As a developer I'm very much in support of CSS variables, but I have a
> couple of questions:
>
> Would variables support values including other variables? E.g.
>
> @var $foo red
> @var $bar $foo

Yes.  This is useful for constructing more complex variables out of
base variables, like setting up a few basic theme colors and then
constructing some themed gradients from them.


> Would variables be possible within the notation for types? E.g.
>
> @var $hue 255
>
> body {
>   background-color: hsla($hue, 50%, 50%, 1)
> }

Yes, variables should be usable anywhere you could put a normal value.


> What will be the effect of using a variable that is not initialised?
> Will this be equivalent to setting an 'auto' value?

Unitialized variables are just invalid values, until they get
initialized through some method.

~TJ

Received on Monday, 7 February 2011 18:42:40 UTC