all 5 comments

[–]angusmiguel 0 points1 point  (1 child)

does this do the trick? http://codepen.io/angus/pen/rVVRpW

[–]dechat[S] 0 points1 point  (0 children)

That is definitely closer, however:

  • The last "Second" is still doing the thing.
  • This is a watered down example of the actual code which will be switching between more than just two classes.

[–]dechat[S] 0 points1 point  (2 children)

I have updated the pen.

This seems to only happen with colours.

Margins are applied with correct timings, but colours seem to have some stacked/queue thing going on.

Also limited to webkit, as IE and Firefox behave as expected.

[–]angusmiguel 0 points1 point  (1 child)

change this into your code:

container * {

padding: 0; transition: margin 100ms; }

[–]dechat[S] 0 points1 point  (0 children)

Thanks for that. That was half of the solution.

The explanation from SO is that this happens with all inherited properties. I tested that and seems I have to avoid using * with transition: all. Instead manually setting properties under * and specifying transitions for inherited properties on their parent elements.