[css-variables] Feature detection and 'variables' (Issue 2)

The introduction of property references may mean we lost the ability to target browser by feature detection. Since ‘variables’ are resolved at computation time, it’s not possible at this time to provide ‘fallback values’ in the case a property doesn’t recognize the value stored in a valid custom property.

The proposal I made to solve this issue is a static checking at the parse time that would reject declarations containing property references whose fallback value isn’t recognized by the browser :
  .selector {
      background: use(my-bg-color);
      background: use(my-super-cool-bg, unsupported-feature(...));
  }
The second declaration of the 'background' property will probably be discarded by the user agent because it doesn't understand the 'unsupported-feature()' function. In this case, the background will use the 'my-bg-color' custom property value. The specification covers more complete rules for this that handles more complex cases.

Received on Thursday, 6 September 2012 09:45:49 UTC