W3C home > Mailing lists > Public > www-style@w3.org > May 2012

Re: [css-variables] Using $foo as the syntax for variables

From: Florian Rivoal <florianr@opera.com>
Date: Wed, 23 May 2012 12:14:53 +0200
To: "Ojan Vafai" <ojan@chromium.org>
Cc: www-style@w3.org
Message-ID: <op.weraq31m4p7avi@localhost.localdomain>
On Wed, 23 May 2012 02:10:39 +0200, Ojan Vafai <ojan@chromium.org> wrote:

> Would someone be willing to summarize what the proposed extensions are?

I know of 2:

1) var-default(foo, default-value) which uses evaluates
to default if foo is undefined or invalid.

2) var-inherit(foo) which uses the inherited value of the variable,
rather than its current value, allowing you to write things like this:

/*nested x elements get alternating background colors*/
x {
x x {


or like this:

/*the width of the border is proportional to the depth in the tree.*/
:root {
* {
   var-foo: calc(var-inherit(foo) + 1px);
   border: var(foo) solid black;
Received on Wednesday, 23 May 2012 10:15:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:16 UTC