Last active
April 21, 2024 22:46
-
-
Save NazCodeland/74e6229f7ce19dc9239fcba8fe2621a0 to your computer and use it in GitHub Desktop.
simple tailwind plugin
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
import plugin from 'tailwindcss/plugin'; | |
/** @type {import('tailwindcss').Config} */ | |
export default { | |
content: ['./src/**/*.{html,js,svelte,ts}'], | |
theme: { | |
extend: {} | |
}, | |
plugins: [ | |
plugin(function ({ addUtilities, addComponents, e, config, theme }) { | |
// Add your custom styles here | |
console.log(addUtilities, addComponents, e, config) | |
const neonUtilities = {}; | |
const colors = theme('colors'); | |
for (const color in colors) { | |
if (typeof (colors[color]) === 'object') { | |
const color1 = colors[color]['500']; | |
const color2 = colors[color]['700']; | |
neonUtilities[`.neon-${color}`] = { | |
boxShadow: `0 0 5px ${color1}, 0 0 20px ${color2}`, | |
} | |
} | |
} | |
addUtilities(neonUtilities) | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment