Toggling a CSS3 animation on click
What is the best way to alternate the direction of a CSS3 animation on click without javascript? I've been exploring checkbox hacks lately and trying to figure out a way to have only one set of keyframes instead of two sets for one going forward and one to come back. Is this possible? Or is there a way to do it with one set? For instance I have the following keyframes: @keyframes moveIt { 0% { transform: translateX(0); width: $size; } 50% { width: $size*1.2; } 100% { transform: translateX(50px); width: $size; } } @keyframes moveItBack { 100% { transform: translateX(0); width: $size; } 50% {