tailwindcss-animate-plugin
v1.1.0
Published
An elegant [animate.css](https://animate.style) plugin for tailwindcss.
Downloads
2
Readme
Tailwindcss plugin for animate.css
An elegant animate.css plugin for tailwindcss.
Install
npm i tailwindcss-animate-plugin
Usage(3 steps)
- Add plugin in
tailwind.config.ts
import animatePlugin from "tailwindcss-animate-plugin";
import type { Config } from "tailwindcss";
const config: Config = {
content: [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
],
plugins: [animatePlugin()],
};
export default config;
- Copy
class
in animate.css, replace__
with--
.
For example: animate__bounce
, change animate__bounce
to animate--bounce
.
- Add below content to your global css file:
:root {
--animate-duration: 1s;
--animate-delay: 1s;
--animate-repeat: 1;
}
@media print, (prefers-reduced-motion: reduce) {
.animate--animated {
animation-duration: 1ms !important;
transition-duration: 1ms !important;
animation-iteration-count: 1 !important;
}
.animate--animated[class*="Out"] {
opacity: 0;
}
}