Skip to content

Instantly share code, notes, and snippets.

@aluissp
Created February 12, 2023 20:45
Show Gist options
  • Select an option

  • Save aluissp/df3fb9bd5d67f08e18ff47e3bd512c26 to your computer and use it in GitHub Desktop.

Select an option

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: [],
};
@janzikmund

Copy link
Copy Markdown

Nice 👍

@spassvogel

Copy link
Copy Markdown

So how do I use this?

@deisner

deisner commented Jul 30, 2024

Copy link
Copy Markdown

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
Copy Markdown

nice, i get it

@spassvogel

Copy link
Copy Markdown

Thank you!

@chattago2002

Copy link
Copy Markdown

Great. Thank you 🤩

@janipang

janipang commented Oct 6, 2024

Copy link
Copy Markdown

good things, Thank you!

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