[csswg-drafts] [css-values-4] Should `pow()`/`sqrt()`/`sign()`/`abs()` only take calculations matching `<number>`? (#10765)

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

== [css-values-4] Should `pow()`/`sqrt()`/`sign()`/`abs()` only take calculations matching `<number>`? ==
[`pow()`](https://drafts.csswg.org/css-values-4/#funcdef-pow) and [`sqrt()`](https://drafts.csswg.org/css-values-4/#funcdef-sqrt) take calculations that must *resolve* to a `<number>`.

There is a note explaining why they only work with numbers. I understand the first argument but the second one confuses me:

  > [...] the result is dependent on what unit you’re expressing the argument in; if `1em` is `16px`, then `pow(1em, 2)` would give `1em`, while `pow(16px, 2)` would give `256px`, or `16em`, which are very different values for what should otherwise be identical input arguments! [...]

First, expecting `1em` as the result of `pow(1em, 2)` would be inconsistent with [`sign(1em)`](https://drafts.csswg.org/css-values-4/#funcdef-sign) or [`abs(1em)`](https://drafts.csswg.org/css-values-4/#funcdef-abs), which must wait for `1em` to be resolved before evaluating their result: 

  > Both of these functions operate on the fully simplified/resolved form of their arguments [...]

Or should `sign()` and `abs()` only work on numbers too?

Second, `opacity: sqrt(100%)` and `color: lab(0 sqrt(100%) 0)` are valid. But what is their resolved value? Or should `pow()` and `sqrt()` take calculations *matching* `<number>`?

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


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

Received on Wednesday, 21 August 2024 07:37:21 UTC