Re: [csswg-drafts] [css-variables] Substitution of invalid variables into other variables (#4075)

I think you're right that the current behavior / WPT aren't matched by the spec, which would treat your second rule equivalent to `#inner { --y: unset; }`.

The [following paragraph](https://drafts.csswg.org/css-variables/#syntax) makes a custom property invalid if it uses `var()` references with invalid _grammar_:

> In addition, if the value of a custom property contains a var() reference, the var() reference must be valid according to the specified var() grammar. If not, the custom property is invalid and must be ignored.

But, the example you gave has valid grammar, it is only invalid at computation time.

Changing the spec to match implementations & tests would be the easiest course of action. So the question is, what is the cost of doing that?

What use cases are prevented by the current behavior? Is it confusing for authors (e.g., when working with Houdini APIs) that custom properties behave differently from regular properties in this case?

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4075#issuecomment-507342433 using your GitHub account

Received on Monday, 1 July 2019 16:47:48 UTC