W3C home > Mailing lists > Public > www-style@w3.org > October 2015

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

From: Xidorn Quan <quanxunzhen@gmail.com>
Date: Wed, 21 Oct 2015 10:58:40 +1100
Message-ID: <CAMdq69_q7tCPmvyU9d2S-RR2NUkU1-c7BDkLqUQKyjyc1AGdhw@mail.gmail.com>
To: Lea Verou <lea@verou.me>
Cc: www-style list <www-style@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:57 UTC