[csswg-drafts] [css-values-4] What happens sign(%) when % has no meaning? (#12204)

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

== [css-values-4] What happens sign(%) when % has no meaning? ==
Spin-off from https://github.com/w3c/csswg-drafts/issues/12192:

In e.g. `width: calc(1px * sign(10% - 10px))`, the result depends on what `%` resolves to, and that's fine. However, what about:

```
z-index: sign(10%);
```

Percentages aren't accepted by `z-index`, and so they don't really resolve against anything. https://github.com/w3c/csswg-drafts/issues/12192#issuecomment-2880773093 suggest that `sign()` should take the value "as-is" (use the sign of the literal percentage value), but that doesn't work for e.g.:

```
z-index: sign(10% - 1);
```

By default I'd expect both examples to be invalid at parse-time.

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


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

Received on Friday, 16 May 2025 12:52:22 UTC