Skip to content

Instantly share code, notes, and snippets.

@atomtigerzoo
Created May 6, 2025 07:48
Show Gist options
  • Save atomtigerzoo/2ed459cb69c497b24b5a2397bb01bd2d to your computer and use it in GitHub Desktop.
Save atomtigerzoo/2ed459cb69c497b24b5a2397bb01bd2d to your computer and use it in GitHub Desktop.
TailwindCSS custom background animation fade-in/out
<div class="animate-pulse-bg from-transparent to-sky-300">Background pulse</div>
[...]
theme: {
extend: {
animation: {
'pulse-bg': 'pulse-bg 2s ease-in forwards'
},
keyframes: {
'pulse-bg': {
'0%': { backgroundColor: 'var(--tw-gradient-from)' },
'50%': { backgroundColor: 'var(--tw-gradient-to)' },
'100%': { backgroundColor: 'var(--tw-gradient-from)' },
}
}
},
},
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment