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

[css-animations] Multiple identifiers per @keyframes rule

From: Lea Verou <lea@verou.me>
Date: Tue, 20 Oct 2015 19:16:47 -0400
Message-Id: <AE7453A4-B41F-41C0-8819-18AED79D0BB3@verou.me>
To: www-style list <www-style@w3.org>
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?

[1]: http://dabblet.com/gist/24c756eb35a67e34d7a9 <http://dabblet.com/gist/24c756eb35a67e34d7a9>

Lea Verou ✿ http://lea.verou.me ✿ @leaverou








Received on Tuesday, 20 October 2015 23:17:10 UTC

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