[csswg-drafts] [css-values-4] Allow combining number and percentage (#7485)

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

== [css-values-4] Allow combining number and percentage ==
In CSS Values 4, [10.9. Type Checking](https://drafts.csswg.org/css-values-4/#calc-type-checking):

> Note: In previous versions of this specification, **multiplication and division were limited in what arguments they could take**, to avoid producing more complex intermediate results (such as `1px * 1em`, which is `<length>²`) and to make division-by-zero detectable at parse time. **This version now relaxes those restrictions**.
>
> [...]
>
> Note that `<percentage>`s relative to `<number>`s, such as in `opacity`, are not combinable with those numbers — `opacity: calc(.25 + 25%)` is invalid. **Allowing this causes significant problems with "unit algebra" (allowing multiplication/division of `<dimension>`s)**, and in every case so far, doesn’t provide any new functionality. (For example, `opacity: 25%` is identical to `opacity: .25`; it’s just a trivial syntax transform.)

Is the second note obsolete or is there a reason not to allow combining `<percentage>` and `<number>` when `<percentage>` is resolved relative to `<number>`?

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


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

Received on Monday, 11 July 2022 13:05:50 UTC