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

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

== [css-variables] Are custom properties strings? ==
Is a custom property a token sequence that only _serializes_ as the original string, or _is it_ that original string? The difference can be seen in this example:

```
.container {
  --x:foo 1.00;
}
.container > div {
  @container style(--x:foo 1) {
    color: green;
  }
}
```

If custom properties are token sequences, this style query matches, but not if they are strings.

The point of serializing using the original string was to preserve "unknown stuff", and maintaining that idea probably means that we don't transform that unknown stuff before comparisons. Otherwise e.g. `style(--uuid: 12345678-12e2-8d9b-a456-426614174000)` would match `--uuid: 12345678-1200-8d9b-a456-426614174000` (example stolen from https://drafts.csswg.org/css-variables/#serializing-custom-props, then modified). 

---

Note that `style(--x:1)` would still match e.g. `--x:1.00` according to the current plan in https://github.com/w3c/csswg-drafts/issues/8376, since the literal side matches `<number>`. 

@tabatkins 

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


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

Received on Monday, 6 March 2023 23:01:04 UTC