W3C home > Mailing lists > Public > www-style@w3.org > July 2012

Re: [css3-lists] Where can the counter() function be used?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 9 Jul 2012 00:16:59 -0700
Message-ID: <CAAWBYDAOXZ9jWJpDc4ieVQtoYophGRg-O5fQzP0KnE2Zx7StSg@mail.gmail.com>
To: Mårten Björk <marten@gosse.se>
Cc: www-style@w3.org
On Thu, Jul 5, 2012 at 11:05 PM, Mårten Björk <marten@gosse.se> wrote:
> I'm the one who initially filed the bug in the WebKit project. Use case: fading in a bullet list, one item at a time. Today, you have to declare an animation-delay for each item.

Yeah, as we discussed on Twitter, the use-case seems pretty obvious.
Counters have a very interesting set of scope rules which can be
pretty useful sometimes.  Variables, currently, use a much simpler
form of scope rules that won't address your use-case.

One way this could be solved would be to allow math on counter values
(which are just integers), such as allowing the counter() function
inside of calc().  Then you could write your use-case as:

animation-delay: calc(counter(delay-timer) * 1s);

Received on Monday, 9 July 2012 07:17:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:18 UTC