- From: Christoph Päper via GitHub <noreply@w3.org>
- Date: Sat, 28 Feb 2026 20:52:57 +0000
- To: public-css-archive@w3.org
In the example(s) presented here so far, the unit is always remultiplied with the modified unit-less value: `u(foo) * func(v(foo))`. The same result can be achieved with a constant value (like `1px`) already: `bar * func(foo / bar)`. The only difference is that the author chooses the unit of that constant. `progress(foo, 0, 1)` In the latest example, `calc(u(var(--size)) * sqrt(pow(v(var(--size)), 2) - pow(v(var(--size)) / 2, 2)) / 3)` can be simplified to `calc(var(--size) / sqrt(12))` if my math is not mistaken, but I assume there is a systematic formula in there. If some calculations like that are frequently needed or at least helpful, it may actually make more sense to add specialized math functions to CSS (like `hypot()` for the hypotenuse of a right triangle, the diameter of a rectangle or, generally, the Euclidean norm) than it would to introduce unit conversion functions. Authors might also find clever ways to use other existing functions like [`calc-mix()`](https://drafts.csswg.org/css-values-5/#calc-mix) or, more interestingly, [`calc-interpolate()`](https://drafts.csswg.org/css-values-5/#calc-interpolate), e.g. with [`cubic-bezier()`](https://drafts.csswg.org/css-easing-2/#cubic-bezier-easing-functions), in clever ways that avoid unit conversion. -- GitHub Notification of comment by Crissov Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13550#issuecomment-3977801900 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 28 February 2026 20:52:58 UTC