Re: [css-animations] Multiple identifiers per @keyframes rule

On Wed, Oct 21, 2015 at 10:16 AM, Lea Verou <lea@verou.me> wrote:
> Use case: [1] (applying the same animation when a checkbox is checked AND
> unchecked). Many similar use cases exist, for each pseudo-class (I’ve come
> across this before for :hover and :not(:hover), as well as for :focus and
> probably more).
>
> Being able to have multiple names per @keyframes rule would eliminate the
> duplication of having two identical @keyframes rules without forcing us to
> completely rethink animations to accomodate such use cases.
>
> YES, it’s totally a hack, as the intent here is event-based animation. But
> the use cases are many and valid. Authors do need this, and the answer
> cannot be “Just learn JS and use WebAnim”. That’s a huge barrier there for
> non-programmers, who will instead resort to duplicating their @keyframes
> rule, because it’s simpler (especially if they’re using some sort of
> preprocessor). However, we also cannot completely rethink css-animations at
> this point. So, I think it’s a reasonable, easy to implement, compromise.
>
> Thoughts?

Interesting use case. Yes it seems like a valid usage, but allowing
multiple identifiers per @kerframes rule doesn't seem to make much
sense otherwise.

Given the rule is that animation occurs when `animation-name` is
overridden, what about extending `animation-name` to accept an
optional extra component after each animation name, which doesn't have
meaning itself, just for triggering the overriding?

- Xidorn

Received on Tuesday, 20 October 2015 23:59:46 UTC