Composable animations⚡⚡⚡ #2403
Larsklopstra
started this conversation in
Ideas
Replies: 1 comment
-
Totally agree. There is a plugin that allows for composable animations like this (https://github.com/benface/tailwindcss-animations) but it has beed deprecated since Tailwind launched their own animation feature. However, tailwind animation support is not composable so it's not very powerful. Tailwind is using CSS variables more and more to allow for greater composability so this should be right up their alley. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, recently I came across something I'd love to have in Tailwind CSS.
Case
Imagine you want a specific animation like a bouncing button to happen twice for 250ms with the
ease-in-out
transition timing. Currently, this is not possible, you'll have to do JavaScript which does something onx
or write your own animation. This proposal will solve that.Current implementation
.animate-bounce
=>animation: bounce 1s infinite;
Proposed implementation
.animate-bounce .animate-250ms .animate-count-2
=>animation: bounce var(--animate-duration) var(--animate-count);
By default, the original values will be used for the variables so it'll stay backwards compatible. You could also introduce more variables if necessary such as
animation-direction
,animation-delay
, or evenanimation-name
!Here's a more detailed example:
You get the idea now, don't you?
Let me know what you think, it could be a powerful method to composite animations.
Beta Was this translation helpful? Give feedback.
All reactions