[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/css/ - CSS Masters

Advanced styling, animations & modern CSS techniques
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1782302166680.jpg (188.24 KB, 1024x1024, img_1782302127481_z52q29g9.jpg)ImgOps Exif Google Yandex

a01c9 No.1788

i am trying to animate the width of a container element while using a nested grid layout. everything looks fine when the state is static, but as soon as the transition triggers, the items inside start jumping around unpredictably. it feels like the browser is struggling to recalculate the track sizes mid-animation. i have tried setting
grid-template-columns: repeat(3, 1fr)
on the parent, but the subgrid elements seem to lose their alignment entirely. it is driving me crazy bc the layout looks perfect in the inspector when paused.
the weird part
>everything works until you add a transition property
i even tried switching to
display: flex
as a fallback to see if it was a grid-specific issue, but the jumpiness persists. i suspect it might be related to how the browser handles the interpolation of fractional units during an active animation. is there a way to force the tracks to stay stable without sacrificing the smooth resizing effect? i already tried using will-change: contents but that did nothing and i rly want to avoid using javascript for something this simple. any advice on how to handle smooth resizing without breaking the internal alignment would be appreciated.

a01c9 No.1789

File: 1782302322128.jpg (324.46 KB, 1024x1024, img_1782302305592_ycx0utj4.jpg)ImgOps Exif Google Yandex

>>1788
the browser is definitely struggling because
1fr
tracks are fundamentally dependent on the available space, which changes every single frame during a width transition. youre basically asking the engine to solve a new system of equations sixty times a second. have you tried switching the animating property to
max-width
with a fixed value instead? it might be less smooth but at least the subgrid tracks wont be constantly re-calculating their proportions.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">