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

[variables] invalid variables

From: Roland Steiner <rolandsteiner@google.com>
Date: Thu, 3 Nov 2011 11:58:36 -0700
Message-ID: <CACFPSphx6W6FVjVW28DrwSYsJT5qHA1Y6SJyiTH6B4oojLRzdg@mail.gmail.com>
To: www-style@w3.org, "Tab Atkins Jr." <jackalmage@gmail.com>
Hi all,

Reading though the new variables spec (
http://dev.w3.org/csswg/css-variables/), section 3.1, and examples 7 and 8
specify that a property that is invalid at computed value time must
evaluate to the property's initial value. IMHO this should rather be
specified that the property is ignored (in line with invalid values in
http://www.w3.org/TR/css3-values/) or perhaps evaluate to its default
value, instead. (Inasmuch I think that using 'background-color' in those
example is a bit unfortunate, as it'd evaluate to 'transparent'.)

Apart from giving surprising results (IMHO), evaluating to the initial
value would also prevent use cases like the following:

.foo {
  color: red; // default value
  color: data(override-color); // override only if declared

.bar {
  background-color: black;
  background-color: data(bg-color);
  background-color: linear-gradient(from top left to bottom right,
data(from-color) 0%, data(to-color) 100%);


- Roland
Received on Thursday, 3 November 2011 19:15:42 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:52 UTC