Kevin Powell - CommunityKP-C
Kevin Powell - Communityβ€’2y agoβ€’
7 replies
LanFeusT

Scale animation with CSS Grid causes pixel gap issues

I have a weird one for you all... it seems that animating the scale while using CSS grid, causes the browser not to calculate the widths quite properly and if you have a 1px gap between the grid items the gap will come in and out as you resize the window

You can see it in action here: https://codepen.io/LanFeusT/pen/RwzGVWK try resizing the browser window and you'll see the grid at the top which has the entrance animation will have the gap: 1px come in and out whereas the bottom one the gap is always visible

Outside of animating something else than scale (translate for example) I don't really see another solution?
image.png
image.png
Was this page helpful?