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

Re: [css3-value] calc and child selectors (was: Proposal for Touch-Based Animation Scrubbing)

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 30 Nov 2012 10:27:50 -0800
Message-ID: <CAAWBYDBDZtDZLOAWu+HmSUbe5URFLXExMiCms_ER8-NakmAu5A@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: www-style list <www-style@w3.org>
On Fri, Nov 30, 2012 at 10:14 AM, Rik Cabanier <cabanier@gmail.com> wrote:
> Please disregard if this was already brought up.
> While looking at Tab's proposal for an image carousel, I saw the following
> idiom:
>
> .carousel > img:nth-child(1) { animation-delay: 1s; }
> .carousel > img:nth-child(2) { animation-delay: 2s; }
> ...
>
> Could this be replaced with a new keyword for calc()?
> For instance, if you want all the images under .carousel to turn one by one,
> you could write:
>
> .carousel > img { animation-delay: calc(nth-child * 1s); }
>
> This new keyword would only be valid inside a child selector and return the
> sibling order.

I've looked into doing something like this in the past.  I'm in favor
of some more powerful calc() stuff, and will definitely try to get
something like it into the next version of V&U.

~TJ
Received on Friday, 30 November 2012 18:28:40 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT