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: Simon Sapin <simon.sapin@kozea.fr>
Date: Fri, 30 Nov 2012 20:18:27 +0100
Message-ID: <50B90683.70103@kozea.fr>
To: www-style@w3.org
Le 30/11/2012 19:28, François REMY a écrit :
> I’ve a better proposal for this in the CSS Custom Properties and References
> spec. The idea would be to rely on the value of a counter.

Oh yes please. Much more flexible than counting among the parent’s 
children, and counters are already there.

The downside is that (I think) counters get their value after box 
generation, so this would make the computed value of calc() more 
complicated. (Computed values are determined before box generation.)


>      .carousel {
>          counter-reset: index;
>          & > img {
>              counter-increment: index;
>              animation-delay: get(1s * counter index);
>          }
>      }

Syntax nitpick: I’d rather reuse the existing counter() function and 
allow it in calc(). This is much easier to parse that trying to group 
whitespace-separated keywords.

The difference is that in numeric context (like calc()) it would 
"return" an <integer>, while in string context (every usage so far) it 
returns a <string> based on a counter type.


Cheers,
-- 
Simon Sapin
Received on Friday, 30 November 2012 19:18:57 GMT

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