-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Staggered Animations #15
Comments
Related to romboHQ#15 Add support for staggered animations with incremental delays for list or grid items. * **src/modifiers.js** - Add a new utility `motion-stagger` to handle staggered delays for multiple elements. - Update the `motion-delay` utility to support staggered delays. - Add a new theme configuration for `motionStagger` with predefined values. * **README.md** - Add documentation for the new `motion-stagger` utility. - Provide usage example for staggered animations.
I'd love to add this feature, but I'm not sure how to do it with CSS. Maybe in the future, we can use something like sibling-index(), but for now, it's not supported. If anyone has an idea on how to implement it, I'd love to hear it. In the meantime, I think the best way to do this is with CSS variables, something like this: |
This is a way to do it const motionDelays = {
0: "[--motion-delay:0ms]",
1: "[--motion-delay:50ms]",
2: "[--motion-delay:100ms]",
3: "[--motion-delay:150ms]",
};
items.map((item, i) => (
<div className={`motion-translate-y-in-100 ${motionDelays[i as keyof typeof motionDelays]}`}>{item.name}</div>
) Probably not as clean as the |
Proposal to add support for staggered animations in the library, allowing for incremental delays on list or grid items.
This feature would enable smoother and more appealing animation effects without relying on manual utilities or JavaScript.
Thank you for considering this request!
The text was updated successfully, but these errors were encountered: