W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2019

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

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Sun, 03 Mar 2019 04:25:12 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-468987224-1551587111-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:45 UTC