bentzibentz / tailwindcss-animate.css

Animate CSS plugin for Tailwind CSS
MIT License
134 stars 17 forks source link
animatecss awesome awesome-list css tailwind-css tailwindcss tailwindcss-plugin

GitHub release npm npm npm bundle size GitHub top language License

Animate CSS - Tailwind CSS Plugin

Add Animate CSS as Tailwind CSS plugin to your project.

Important Information

Tailwindcss >= v3.1.8 is required.

Installation

Pull it in through npm or yarn:

npm install tailwindcss-animatecss
yarn add tailwindcss-animatecss

Use animatecss < v4:

npm install tailwindcss-animatecss@0.3.3
yarn add tailwindcss-animatecss@0.3.3

Usage with Tailwind v1 and v2

For Documentation checkout Branch feature/v2

npm install tailwindcss-animatecss@1.0.8
yarn add tailwindcss-animatecss@1.0.8

Usage

Add Tailwind CSS to your project as described here. Install tailwindcss plugin as described above and add it to your tailwind.config.js file.

plugins: [
    // Other plugins
    require('tailwindcss-animatecss'),
]

You want to determine yourself which classes are used? You just have to set these class names at the classes array. For example if you want .animate__fadeIn just add fadeIn to the array. You can find all available class names further down.

Defining the classes is recommended to avoid to bloat your css with unused classes and keyframes.

// tailwind.config.js
module.exports = {
    theme: {
        animatedSettings: {
            animatedSpeed: 1000,
            heartBeatSpeed: 500,
            hingeSpeed: 2000,
            bounceInSpeed: 750,
            bounceOutSpeed: 750,
            animationDelaySpeed: 500,
            classes: ['bounce', 'heartBeat']
        }
    },
}

If you want to prefix your CSS classes, use the tailwind prefix option:

// tailwind.config.js
module.exports = {
  prefix: 'tw-',
  // ...
}

Adjustable, optional settings

All of these settings are optional, if not set basic animate.css fallback animationDuration speed is used.

The plugin generates all the animate.css utility classes for you.

Variants

Generating different class variants is super easy, tailwind does all the work for you.

Available Animate CSS classes

Demo

Coming soon…

Credits

This package is based on awesome Animate.css.

More Tailwind CSS Plugins

tailwindcss-layered-box-shadow

tailwindcss-absolute-center

License

This project is licensed under the MIT License.