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
// Plugin to add each Tailwind color as a global CSS variable | |
function addVariablesForColors({ addBase, theme }: any) { | |
const allColors = flattenColorPalette(theme('colors')); | |
const newVars = Object.fromEntries( | |
Object.entries(allColors).map(([key, value]) => [`--${key}`, value]) | |
); | |
addBase({ | |
':root': newVars, | |
}); |