Re: [csswg-drafts] [css-variables] Are custom properties strings? (#8533)

> Given --x: /* comment */ 1, style(--x: 1) would be true? Comments are removed with leading/trailing whitespaces when consuming a declaration (but not with CSSStyleDeclaration.setProperty() though).

No, this is specifically not the case when serializing custom properties; see <https://w3c.github.io/csswg-drafts/css-variables/#serializing-custom-props>

> Given --x: 1.0 and opacity: var(--x), style(opacity: 1) would be false. Right?

It's not yet clear if we'll allow style() queries on non-custom properties, but I can definitely say that if we do allow them, then no, that query would match. We'd *at minimum* base the comparison on the used-value serialization, which absolutely normalizes these things. This'll have nothing to do with whatever we do to custom properties.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 10 March 2023 18:38:18 UTC