W3C home > Mailing lists > Public > www-style@w3.org > March 2010

Are CSS animations a done deal?

From: Lars Gunther <gunther@keryx.se>
Date: Sun, 28 Mar 2010 17:32:54 +0200
Message-ID: <4BAF76A6.1080200@keryx.se>
To: www-style@w3.org

The recent discussion about CSS transitions and animations made me 
wonder if it has been finally decided that CSS animations will become a 
W3C recommendation?

I am a big fan of declarative animation and would not like for this to 
disappear into thin air.


Does animation really belong in CSS? Can someone point me to the 
discussion where this was discussed and perhaps even decided?



Why am I suspicious?

1. There are many things that could trigger an animation, as opposed to 
a transition. Not only clicks, focus and hover, but also submits, 
gestures, various load states, changes to the DOM, etc. For this reason 
JavaScript authors will write wrapper functions and through these 
wrapper functions animations will be triggered for a majority of all use 

2. Manipulation of style and the DOM is done through scripting today. If 
animation is done imperatively it's through the DOM, if done 
declaratively it should be the same.

This aligns with how we have been teaching standards for a while now:

- HTML for basic structure and content.
- CSS for design and layout.
- The DOM for behaviour.

For reasons like these I think it would be more reasonable to declare 
the animation using JSON notation and have a dedicated DOM function to 
do the animation.

Today this can of course be done by adding or removing classes, however, 
but I think my idea is conceptually more clean.

document.getElementById("foo").addEventListener('click', loadAnimation, 

function loadAnimation() {
         "animation-name": "foobar",
         "animation-duration": "8s",
         "animation-iteration-count": "infinite"

foobar = {
     // Keyframe rules

Lars Gunther
Received on Sunday, 28 March 2010 15:33:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:44 UTC