Re: [csswg-drafts] [css-values] Let B default to 1 in `round(<strategy>?, A, B)` (#9668)

> The point was for rounding when only having a single unit. So, `round(1em + 10px)` would still be invalid.

Would `round(3.14159em + 2.71828em)` be valid, then? The unit is consistent/clear, but it seems like this could still be tricky/confusing. It looks "obvious" what to do when the units are right there, but what about when you have `round(--var(foo) + --var(bar))`, where `foo` and `bar` are both lengths? Whether the `round` works (and what it means) then depends on how they were defined in this particular context. I think that's getting too obscure and footgun-ish to be useful.

Making the precision default to `1` (as a number) only, in contrast, is clear and simple, while rounding anything other than a number requires being explicit about the unit of rounding.

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


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

Received on Wednesday, 6 December 2023 21:54:22 UTC