Customizing animation repeat count and animation duration with utilities #17659
rozsazoltan
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Update
After understanding the implementation of variables, you can familiarize yourself with the
animation-iteration-count
andanimation-duration
property, which has been part of the baseline since 2015.animate-repeat-*
andanimate-duration-*
with CSS variablesanimate-repeat-*
andanimate-duration-*
with CSS animation propertiesanimation-iteration-count
- MDN Docsanimation-duration
- MDN DocsOriginal Code
The other day, I created utilities for customizing the repeat count and timing of any animation. I’ll leave them here in case they are useful for someone else:
In the final solution, I was assisted by Wongjn's answer. The default animations can be overridden by using
@theme inline
instead of@theme
to declare the animation. This doesn’t add any extra overhead if the animations used are already part of the project, as they will end up being part of the compiled CSS anyway.Utility for Repeat Count -
animate-repeat-*
Utility for Animation Timing -
animate-duration-*
Beta Was this translation helpful? Give feedback.
All reactions