Re: [csswg-drafts] [css-values] Differences between calc() handling for <length-percentage> values. (#3482)

> **Should `calc(%)` always be treated the same as `%`**
> 
> https://drafts.csswg.org/css-values-4/#calc-serialize says
> 
> > If this simplification process results in only a single value (one `<number>`, one `<dimension>`, or one `<percentage>`), and the value being serialized is a computed value or later, serialize it just as that one value, without the `calc()` wrapper.
> 
> I think it would be bad if the serialization is the same but the behavior can be different.

It depends how the `calc()` is threated. In my mind the `calc()` is threated like mathematical operation similar to **(A + B)** so for example if `calc(A + B)` is same as **(A + B)** so the `calc(%)` will be same as **(%)** and therefore is no matter if it is with out without those brackets. The different case is when you are using it to calculate something in real time in depency on some attribute like `vw` or `vh`. If it is the real time case, `calc(%)` will never be same as % because browsers are limited in rounding numbers.
 

-- 
GitHub Notification of comment by Ernedar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3482#issuecomment-451472187 using your GitHub account

Received on Friday, 4 January 2019 15:17:29 UTC