ingram-projects / animxyz

The first truly composable CSS animation library. Built for Vue, React, SCSS, and CSS, AnimXYZ will bring your website to life.
https://animxyz.com
MIT License
2.4k stars 56 forks source link

Feature request: stackable delay #43

Open florian-lefebvre opened 3 years ago

florian-lefebvre commented 3 years ago

It would be nice if there was a "delay-parent" xyz attribute or something like that, for the child to take that delay as a reference. For example:

<div xyz="delay-15 delay-parent" class="xyz-nested"> <!-- = delay-15 -->
      <div xyz="delay-3" class="xyz-nested"></div> <!-- = delay-18 -->
</div>
milesingrams commented 3 years ago

That is a good idea and definitely something we plan to allow. Right now I'm working hard on making animxyz utilities generated in a postcss plugin so that only the ones you use show up in your stylesheet (think purgecss but generated instead of removed). Once we implement this capability we will be able to add a lot more utilities at no extra package size cost. This will certainly be one of the ones we add. Although how do you feel about the naming being xyz="delay-parent-15" instead of xyz="delay-parent delay-15"?

florian-lefebvre commented 3 years ago

It sounds great for both postcss plugin and naming!