Created
February 24, 2022 14:13
-
-
Save jeremyfrank/7b0cf23c57244bebf3ccfe9040982ed9 to your computer and use it in GitHub Desktop.
Animation delay plugin for Tailwind CSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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