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

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.

Simon Sapin

Received on Friday, 30 November 2012 19:18:57 UTC