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

[css-variables] CSS Referencing

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Sun, 8 Jan 2012 19:18:54 +0100
Message-Id: <B504143C-7275-4AD2-9AC1-9DD7E50C23EF@crissov.de>
To: www-style list <www-style@w3.org>
Matthew Wilcox (2012-01-05 18:08):

> div#one { height: #two; }
> div#two { height: #one; }

Functionality like this has been requested and hence discussed many a time before. The current Editor’s Draft related to it is located at <http://dev.w3.org/csswg/css-variables/>.

Your choice of words, however, made me think. Could exclamation mark syntax, as known from ‘important’, work for variables?

  foo {property: common-value   !set(myvar);}
  bar {property: fallback-value !get(myvar);}

gets the relative, specified value in another place. It would be cool if you could also use the absolute, computed value elsewhere,

  baz {property: fallback-value !use(myvar);}

but since “foo” doesn’t need to be unique it probably can’t work, except if it were fine to use the last computetd value from the closest (box or element) ancestor.

Furthermore, this hardly works with shorthand properties, because you could only store and recall a complete set of values, not single ones. 
I’m not sure the Grammar allowed exclamation marks inside pseudo functions:

  quuz {property: calc(1px + 1px !use(myvar));}
Received on Sunday, 8 January 2012 18:19:23 UTC

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