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

Re: [csswg-drafts] [css-values] Round to design grid module (#2513)

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Fri, 13 Dec 2019 00:12:49 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-565244611-1576195968-sysbot+gh@w3.org>
I think floor(), ceil(), and round() all have very reasonable use-cases. (And adding any one of them allows one to implement the other two, so might as well add them as a group.)

Unlike in JS, CSS doesn't have a default scale to round to, so all three of the functions will require a precision. The only difference between floor/ceil/round will be which direction is favored when the value is between steps of the precision.

As you say, @Crissov, an alternative syntax would be add a single round() function, and let it have an optional *third* argument that dictates how to round it, like `round(15em, 10px, floor)` or something. It needs to be comma-separated from the precision, since the precision should be a calculation.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2513#issuecomment-565244611 using your GitHub account
Received on Friday, 13 December 2019 00:12:51 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:27:05 UTC