All right, we just went thru the JS Math object and reviewed every single function for inclusion into CSS. Results:
1
20
1
60
Adding:
* round(), with keywords to select rounding behavior (nearest, up, down, toward-zero)
* mod(), with an issue to decide later whether we use JS or math semantics for negative values
* sign() (numbers only)
* abs()
* exp()
* log()
* e and pi, as keywords in math funcs
6
3
5
30
Not adding:
* cbrt() (no real use-case, can add later if needed)
* hyperbolic trig functions (same)
* the other constants (same)
* fround(), clz32(), imul() (weird bit stuff)
* random() (totally distinct feature, v complicated)
* the log() and exp() variants (just use math)
3
3
And that's everything.
Now that we have the e and pi precedent, we'll discuss adding infinity (and maybe -infinity?) as constants after the break (right now you have to spell them as 1/0 or -1/0 when serializing, which is weird).
1
1
Heck, let's straw-poll the mod issue:
What should be the answer to mod(-8px, 5px)?
(feel free to RT for reach)
62%
-3px
38%
2px
139 votes • Final results
7
19
1
4
That's gonna get really odd if 0 is in the middle of the range and half way through the behavior changes.
1
1
I think this is the argument that the answer to the poll should be 2px. (At least, that's why I think it should be 2px.)
Jan 22, 2020 · 11:54 AM UTC


