W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2019

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

From: Amelia Bellamy-Royds via GitHub <sysbot+gh@w3.org>
Date: Mon, 01 Jul 2019 16:47:45 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-507342433-1561999664-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:50 UTC