Replies: 5 comments 9 replies
-
Facing the same issue here, would be a nice feature to have. |
Beta Was this translation helpful? Give feedback.
-
any solution brother? |
Beta Was this translation helpful? Give feedback.
-
I know I'm super late with this, but you can extend tailwind by adding a utility class. These automatically get the variants: https://tailwindcss.com/docs/adding-custom-styles#using-css-and-layer. This needs to be added in the CSS file you're declaring tailwind in: I've included the Tailwind declaration just so it's clear which file you'll need to put this in. Also this is for Tailwind 3.
Now you can simply use the class: hover:pause |
Beta Was this translation helpful? Give feedback.
-
For anyone coming here for a solution that works on Tailwind v4, here's what I ended up with: @utility pause-animation {
animation-play-state: paused;
} which lets you use it like it's a native utility, e.g.:
|
Beta Was this translation helpful? Give feedback.
-
It would be great addition , utility is also missing for @utility animate-infinite {
animation-iteration-count: infinite;
}
@utility animate-once {
animation-iteration-count: 1;
}
@utility animate-twice {
animation-iteration-count: 2;
}
@utility animate-thrice {
animation-iteration-count: 3;
}
@utility animate-iteration-* {
animation-iteration-count: --value(integer, [integer]);
}
/* play state */
@utility animate-run {
animation-play-state: running;
}
@utility animate-play {
animation-play-state: running;
}
@utility animate-pause {
animation-play-state: paused;
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I just noticed that there's no
animation-play-state: paused
in vanilla tailwind.It will be nice if we can use
hover:animate-paused
or something like that.Beta Was this translation helpful? Give feedback.
All reactions