Re: [csswg-drafts] [css-values]: Proposal – Add type conversion functions to mathematical expressions (#13550)

This doesn't work in general.

E.g. what should `v(1px + 2em + 3pt)` be? or imagine `1em = 16px`, then `v(1em)` would be expected to be the same as `v(16px)`, but the former is `1` and the later `16`.

This has been discussed multiple times, e.g. see the explanation in https://www.w3.org/TR/css-values-4/#ref-for-funcdef-hypot%E2%91%A1 or #9668

Instead, you should just divide:

```css
div {
  --size: 2px;
  width: calc(1px * pow(var(--size) / 1px, 2));
}
```

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


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

Received on Monday, 23 February 2026 22:04:27 UTC