Skip to content

Instantly share code, notes, and snippets.

@aluissp
Created February 12, 2023 20:45
Show Gist options
  • Save aluissp/df3fb9bd5d67f08e18ff47e3bd512c26 to your computer and use it in GitHub Desktop.
Save aluissp/df3fb9bd5d67f08e18ff47e3bd512c26 to your computer and use it in GitHub Desktop.
Fade in animation in Tailwind CSS
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {
animation: {
fade: 'fadeIn .5s ease-in-out',
},
keyframes: {
fadeIn: {
from: { opacity: 0 },
to: { opacity: 1 },
},
},
},
},
plugins: [],
};
@chillaxdev
Copy link

+1

@janzikmund
Copy link

Nice 👍

@spassvogel
Copy link

So how do I use this?

@deisner
Copy link

deisner commented Jul 30, 2024

So how do I use this?

See https://tailwindcss.com/docs/animation#customizing-your-theme

After you extend the tailwind config, you can add the animate-fade class to a div (in addition to the built-ins like animate-ping, animate-pulse, etc.).

@rodino2002
Copy link

nice, i get it

@spassvogel
Copy link

Thank you!

@chattago2002
Copy link

Great. Thank you 🤩

@janipang
Copy link

janipang commented Oct 6, 2024

good things, Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment