W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: CSS Variables

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 7 Feb 2011 10:41:47 -0800
Message-ID: <AANLkTimU3m9rKnOnnkNDhPwL3Sp7ibwvnwPB_CP8MBeu@mail.gmail.com>
To: Jon Rimmer <jon.rimmer@gmail.com>
Cc: www-style list <www-style@w3.org>
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.

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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:56 UTC