[ 🏠 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: 1782867573830.jpg (93.31 KB, 1024x1024, img_1782867536375_mvdfzh1v.jpg)ImgOps Exif Google Yandex

337c5 No.1821

trying to animate a group of cards using
display: grid
but the entrance feels way too robotic. i want each item to fade in with a slight delay so it looks more organic and fluid. ive been experimenting with
transition-delay
, but managing individual delays manually is such a painful nightmare when the number of items changes dynamically.
>is there a cleaner way to handle this with css variables?
i was thinking about using nth-child(n) of. card to loop through, but i cant figure out how to pass the index into a custom property without heavy javascript. has anyone found a trick for auto-staggering elements within a grid container? ❓

aa4a1 No.1822

File: 1782868465174.jpg (260.28 KB, 1024x1024, img_1782868450119_flo87hha.jpg)ImgOps Exif Google Yandex

>>1821
you can avoid the manual work by just setting a single -i variable on each card via inline styles when you map them, then use transition-delay: calc(var(-i) * 0.1s) in your css. it's way more scalable flexible once the loop handles the index for you.



[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">