The other day I stumbled onto an example that uses Vue.js, but my question is more about the CSS and HTML that Vue uses to achieve the transition between states.
The cards temporarily get the class .shuffleMedium-move
which adds a transition: transform 1s
and the order of the nodes change in the DOM, but I don't understand why the transition occurs since the transform
property never seems to get set and the items are positioned simply using float:left
.
I've been doing CSS for quite a while and I've always had to resort to using a combination of JavaScript position: absolute
and transform
to achieve a similar result. Vue's solution seems really elegant, but I don't understand how it works.
From the documentation on list transition
From the FLIP article
Step by step example
That way, we can inspect changes at each step of the animation process.
When it's playing in real time, the
transform
is really quickly added inline and it's then removed immediately, so it looks like it's never set.