Is there any way to have a transition on the order of flex-box items?
In other words, can I have this (details in this fiddle)
#container { display: flex; } #container:hover div:last-child { order: -1; }
animated (the element getting the new position assumes it's position over time), please?
Sadly no: the order attribute is animatable, but only as integers.
The answer is no. flex-direction is not an animatable property in CSS.
The order property and accessibility Use of the order property has exactly the same implications for accessibility as changing the direction with flex-direction . Using order changes the order in which items are painted, and the order in which they appear visually.
Sadly no: the order attribute is animatable, but only as integers. That means that for each step/frame of the animation it will interpolate the value by flooring to the neareast integer. So items will only ever show up in the slot that the computed integer value results in, never in-between in any smooth sort of motion way.
It's technically still an animation: the calculated integer position should still follow the timing function and keyframe rules of the animation, it's just that the items "jump" from position to position as they change.
See https://developer.mozilla.org/en-US/docs/Web/CSS/integer#Interpolation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With