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

`1% - 1` fails due to a type mismatch (adding the types returns failure); it's an invalid calculation no matter what it's used in. (Percents never resolve against pure numbers in a calc sense, to avoid ambiguous types.)

I believe, per spec, `z-index: sign(10%)` should be valid. *Normally*, using a % in z-index will result in an invalid calculation, since the type won't resolve to anything that z-index allows, but `sign()` washes the unit away, and because it never ended up with a percent hint, that does end up resolving a plain `<number>`. I'm open to finding a way to fix that if desired.

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


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

Received on Wednesday, 21 May 2025 17:50:47 UTC