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

> The `calc()` function either returns a bare decimal value or a decimal value with a unit

Not really, `calc()` can represent values that can't be expressed using literals.

I see 2 possibilities, and I'm not sure which one you are arguing for:

 - `v()` only accepts literals (similar to [`<zero>`](https://drafts.csswg.org/css-values-4/#zero-value)), so `calc()` is invalid.
 - `v()` accepts an arbitrary  `<number> | <dimension> | <percentage>`, so it needs to deal with `calc()`, and this is not "out of scope here".

The former makes more sense to me.

> Let me give an example

You example is not supporting your point. The 3rd component resolves to `calc(1em * sqrt(3) * 5 / 6)`.

If, let's say `1em = 16px`, and you were to use  `--size: 80px`, then it would be `calc(1px * sqrt(3) * 80 / 6)`, which is the same as above.

So you could just use `calc(1px * sqrt(pow(var(--size) / 1px, 2) - pow(var(--size) / 2px, 2)) / 3)` to get the same behavior, no need for `v()` and `u()`.



-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13550#issuecomment-3977484085 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 17:43:04 UTC