[csswg-drafts] [css-variables] CSS-wide keywords in fallbacks (#5325)

andruud has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-variables] CSS-wide keywords in fallbacks ==
Suppose we have: `div { display: var(--undefined,inherit); }`

The _cascaded value_ for `display` is in this example a sequence of tokens (not a CSS-wide keyword), hence the [explicit defaulting](https://drafts.csswg.org/css-cascade/#defaulting-keywords) behavior in the cascade is not triggered. At computed-value time, the `var()` substitutes to `inherit`. This is valid per [css-values](https://www.w3.org/TR/css3-values/#component-types) which states that the grammar of all properties are understood to also allow `unset | initial | (etc)`. This means we end up with a valid value of `inherit` that we somehow have to deal with computed-value time.

It seems useful to be able to use CSS-wide keywords in the fallback, especially with `revert`. We should consider specifying that if a declaration ends up with a CSS-wide keyword after var() substitution, it's resolved at computed-value time similarly to how it's normally done cascade-time. (I'll just have to think about whether this triggers any of the Bad Stuff from #4155).

Or failing that, make it IACVT, but we shouldn't leave it undefined.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5325 using your GitHub account

Received on Wednesday, 15 July 2020 12:53:21 UTC