View transitions: Handling aspect ratio changes

Jake Archibald has some great examples of awkward gotchas with View Transitions. View Transitions are naturally great at tweening one state of a DOM element to the next, but you’ll see likely-unwanted ghosting if the element changes shape from one state to the next. You can either prevent it from changing shape by changing either the starting or ending state, or in the case that you need the different shapes, grab ahold of the parts and have them move individually how you want them to.

I found it satisfying that the answers weren’t in more new exotic web technologies, but just in understanding and using existing CSS layout better.

Wanna learn CSS from a course?

Leave a Reply

Your email address will not be published. Required fields are marked *

Did you know?

Frontend Masters Donates to open source projects. $363,806 contributed to date.