You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>?
The text was updated successfully, but these errors were encountered:
The note is still valid, and in fact was written after adapting calc() to handle unit algebra. Allowing %s to resolve to an empty type (like numbers) would make a lot of definitely-invalid calculations appear possibly-valid, and you wouldn't know they aren't until you actually resolved the percentage's type.
In CSS Values 4, 10.9. Type Checking:
Is the second note obsolete or is there a reason not to allow combining
<percentage>
and<number>
when<percentage>
is resolved relative to<number>
?The text was updated successfully, but these errors were encountered: