Skip to content

Instantly share code, notes, and snippets.

@jeremyfrank
Created February 24, 2022 14:13
Show Gist options
  • Save jeremyfrank/7b0cf23c57244bebf3ccfe9040982ed9 to your computer and use it in GitHub Desktop.
Save jeremyfrank/7b0cf23c57244bebf3ccfe9040982ed9 to your computer and use it in GitHub Desktop.
Animation delay plugin for Tailwind CSS
const plugin = require('tailwindcss/plugin')
module.exports = plugin(({ addUtilities, e, theme }) => {
const pluginConfig = theme('animationDelay', {})
const utilities = Object.entries(pluginConfig).map(([name, value]) => {
return {
[`.${e(`animation-delay-${name}`)}`]: {
animationDelay: value,
},
}
})
addUtilities(utilities)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment