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

Re: [csswg-drafts] [css-values] random() function (#2826)

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Fri, 18 Jan 2019 19:34:26 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-455662480-1547840065-sysbot+gh@w3.org>
> What would happen in case of unclear integers, e. g. rand-int(foo, 10pt, 5mm)?

rand-int() is integers only, not dimensions. But for rand-val(), it's not resolved until computed or used value time, so the start and end points are already fully absolutized, and thus totally clear.

> Could this be solved with counters instead, which are always integers?

Counters are... not something we want to build other features on top of. They have a *lot* of strange quirks.

> Before I comment on the proposals above, I just wanted to make sure we're philosophically on board with the idea of extending the capabilities of CSS as such.

*I* am, but I'm utopian about these things. ^_^ I've been thinking about randomness in CSS for many years. At bare minimum, exploring this space will serve as a great case-study for what we need to be sure that we expose for Houdini Custom Functions; I want to ensure that authors could create a `--rand-int()` function with this same functionality. So even if we never get this natively implemented, it'll still be useful.

GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2826#issuecomment-455662480 using your GitHub account
Received on Friday, 18 January 2019 19:34:27 UTC

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