Re: [css3-transitions] Transitions and multiple backgrounds

On Feb 4, 2013, at 9:47 AM, L. David Baron <dbaron@dbaron.org> wrote:

> So I think we should require matched lengths for the properties
> whose lengths matter:  in other words, we should still require
> matched lengths for background-image.  I have no idea what it would
> mean to do otherwise.

One option would be to cross-fade() from some kind of transparent image.

For shadow transitions (box-shadow, text-shadow), WebKit does
allow transitions between lists of different lengths, synthesizing
the missing shadows (using shadows with zero radius and spread,
matching "inset" with the corresponding shadow, and choosing a sensible
color (possibly "transparent").

> But for the properties whose values get
> repeated to match the length of the background-image list, we
> shouldn't require matched lengths.
> 
> Then there's the question of what the computed value should be
> during the animation.  I think, however, there's a relatively simple
> solution, which I implemented in Gecko for animation of
> stroke-dasharray.
> 
> We should define two animation concepts, "list" and "repeatable
> list".
> 
> A "list" is the current definition; to interpolate, the lengths of
> both lists must match.
> 
> A "repeatable list" yields an interpolation result whose length is
> the least common multiple (lcm) of the lengths of the two input
> lists.  Both input lists are repeated to that length, and then
> interpolation is value-by-value on the items in that full list.
> 
> We can then define all the background-* list properties except for
> background-image, and stroke-dasharray, to be a repeatable list.

Sounds like a nice approach.

Simon

Received on Monday, 4 February 2013 17:07:27 UTC