Re: [csswg-drafts] [css-values] Calc serialization of subtractions (#3335)

We have percentages, then units in alphabetical order, then functions (min/max/clamp) in the order they were seen (with their arguments simplified using the same logic).

> there are some WPTs using something like`calc(100% + -200px)` and others using `calc(100% - 200px)`. These two inconsistent formats should be fixed. ;(

These should be `calc(100% - 200px)`

The serialization of `calc(70% - min(10%, 200px) + 30%)` should be `calc(100% - min(10%, 200px))`.

`calc(calc(1px + min(2em, 3ex)) - calc(max(5px, 6mm) - 7%) + 8px)` becomes
`calc(7% + 9px + min(2em, 3ex) - max(5px, 6mm))`.

This covers everything other than multiplication and division.


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

Received on Wednesday, 31 July 2019 06:14:32 UTC