Giter Site home page Giter Site logo

bentzibentz / tailwindcss-animate.css Goto Github PK

View Code? Open in Web Editor NEW
129.0 2.0 16.0 756 KB

Animate CSS plugin for Tailwind CSS

License: MIT License

JavaScript 100.00%
tailwind-css css animatecss tailwindcss tailwindcss-plugin awesome awesome-list

tailwindcss-animate.css's People

Contributors

afuno avatar avionbg avatar bentzibentz avatar en3tho avatar flowdee avatar g0shed avatar henryzt avatar jmonday avatar mauriciv avatar shamarkellman avatar sohlring avatar t-zahil avatar vrtxims avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tailwindcss-animate.css's Issues

important breaks the animations

Setting the important: true, for utility classes breaks the animate.css plugin, each animation gets !important at the end of the definition which isn't supported and animations aren't working.
example:

// tailwind.config.js initial part
module.exports = {
  prefix: '',
  important: true,
  // ...
}

compiled css:

@keyframes slideInDown {
  from {
    transform: translate3d(0, -100%, 0) !important;
    visibility: visible !important;
  }

  to {
    transform: translate3d(0, 0, 0) !important;
  }
}

Minify CSS

Hello, I am trying minify CSS with purgecss, but something wrong.
Css file still get up to >2000 lines :c
In that file have there animate:
@-webkit-keyframes fadeOutUp {
to {
opacity: 0;
transform: translate3d(0,-100%,0)
}
}
It only come from this... I don't know how to fix.
image

Custom prefix instead of animate__

addUtilities(
            [
                Object.entries(utilities).map(([key, value]) => {
                    return {
// "animate__" can be a custom variable here instead with "animate__" being a default value if custom is undefined.
                        [`.${e(`animate__${key}`)}`]: value, 
                    }
                })
            ]
        )

What do you think of this idea? Tailwind usually uses '-' as delimiter and I would really like to have things being consistent to one style.
Also, can you please tell me if there was something preventing you from just using "animated", "fadeIn" etc. styles without prefix? Because I would like to have "" prefix as a valid one too.

Dynamically changing speed

Can't seem to dynamically change the speed timing, note you can globally in settings with animatedSpeed: 1000, but being able to document.documentElement.style.setProperty('--animate-duration', '20ms'); won't work as the variable isn't being used on animate__animated.

Not found class name with @tailwindcssinjs/macro

Hi, im using @tailwindcssinjs/macro with tailwindcss-animate.css
I have this code
tw`shadow-md rounded nm-flat-gray-200-lg animate__animated animate__fadeInLeft
It's work well without animate class name. I use other plugin is tailwindcss-neumorphism, it work ok with no error.
Can you do something to make them work together, Thank you :D

Tailwind 1.0 Support

I tried using the plugin with Tailwind v1.0 and it doesn't seem to be working.

Here is my tailwind.config.js

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

When I tried it with your docs example, it was erroring out.

Thoughts?

`release-it` should be a dev dependency

release-it and @release-it/conventional-changelog should be moved to dev dependencies or removed entirely before pushing to NPM because it creates a lot of unnecessary bloat.

A confusing section in README

You want to determine yourself which classes are used? You just have to set these class names at the classes array. Caution, class names without dot and without the animate prefix, for example if you want .animate__fadeIn just add animate__fadeIn to the array. You can find all available class names further down.

v3 compatibility

Hey there, is it possible to upgrade the package to be compatible with Tailwind v3?

Demo missing

Assign this issue to me and I will create demo page.

Why this plugin?

Can I ask you why this plugin?

What if I simply add animate.css to my project?

Example:

index.css:

@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

@import "animate.css/animate";

index.html:

<div class="animate__animated animate__bounce">The div</div>

What is the use of your plugin?

fadeInRight and fadeInLeft don't work

hey, I am trying to use fadeInRight and fadeInLeft animation for my project. But it doesn't work at this point. Here is thetailwindcss.config.js

const defaultTheme = require('tailwindcss/defaultTheme')


module.exports = {
    theme: {
        extend: {
            colors: {
                'blue': '#246CE9',
                'light': '#E8EDFB',
            },
            fontFamily: {
                sans: ['Poppins', ...defaultTheme.fontFamily.sans]
            },
            keyframes: {
                fadein: {
                    '0%': { opacity: 0 },
                    '50%': { opacity: 0.5 },
                    '100%': { opacity: 1 }
                },
            },
            animation: {
                fadein: 'fadein 3s ease-in',
            }
        }
    },
    purge: ['./src/**/*.{js,jsx,ts,tsx}'],
    plugins: [
        require('@tailwindcss/typography'),
        require('tailwindcss-animatecss')({
            classes: ['animate__animated', 'animate__fadeIn', 'animate__fadeInRight', 'animate__fadeInLeft'],
            settings: {
                animatedSpeed: 1000,
                heartBeatSpeed: 1000,
                hingeSpeed: 2000,
                fadeInSpeed: 750,
                fadeOutSpeed: 750,
                animationDelaySpeed: 1000
            },
            variants: ['responsive', 'hover', 'reduced-motion'],
        }),
    ]
}

Then I add animate__fadeInRight to className of my component. But the image doesn't fade in.

Allow users to cherry pick animations in plugin config

So instead of always generating classes for everything in animate.css, I'd like to be able to pass an array of animations (or animation groups aka the labels used for optgroup's on Animate.css' website).

This would reduce the CSS bloat when not using PurgeCSS (can't use it on this site I'm working on for reasons) and help avoid possible name collissions in case the codebase already includes a given classname.

require(...) is not a function when installing

My tailwind.config.js:

/** @type {import('tailwindcss').Config} */

module.exports = {
  content: [
    './pages/**/*.{js,ts,jsx,tsx}',
    './components/**/*.{js,ts,jsx,tsx}'
  ],
  theme: {
    extend: {}
  },

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

Just followed instructions on readme and got this error upon running:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[8].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[8].use[2]!./styles/globals.css
TypeError: require(...) is not a function

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.