Re: [csswg-drafts] [css-values] Trigonometric functions (#2331)

1. Yeah, we'll be using commas for argument separation, so we can use `<calc-sum>` for the arguments. Same as `min()` and `max()`.

2. Yes, plan is for `pow()` and `sqrt()` to only accept `<number>`, so we sidestep the numerical precision issues with their units. You can remove and re-add units yourself easily with some token division/multiplication, it's just some busywork. (To get `pow(2px, 4)` == `16px`, you can instead write `(pow(2px / 1px, 4) * 1px)`.) `hypot()` will take dimensions, because it outputs the same unit type as it inputs, and doesn't do anything funky internally.

3. Adding more functions is on the table if necessary; `abs()` and `mod()`, in particular, are probably worth adding. We don't want to go *too* deep, as there's a lot of possible math stuff one could add, and Houdini Custom Functions is the next spec on my list once I finally finish up Typed OM sufficiently to feel happy building on it.

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

Received on Sunday, 3 March 2019 04:25:13 UTC