Closed rootEnginear closed 1 week ago
This idea is that, instead of passing a selector, you can pass a function that can accept the current node and then return the elements you want by yourself.
Before:
const listFadeOptions = { animate: { elements: '&>li', keyframes: { opacity: [0, 1] }, options: { duration: 1, delay: stagger(0.1) } }, options: { amount: 0.5 } };
After:
const listFadeOptions = { animate: { elements: (node) => node.children, keyframes: { opacity: [0, 1] }, options: { duration: 1, delay: stagger(0.1) } }, options: { amount: 0.5 } };
Implemented in v0.5.0!
This idea is that, instead of passing a selector, you can pass a function that can accept the current node and then return the elements you want by yourself.
Before:
After:
Pros
Cons