Skip to content

Instantly share code, notes, and snippets.

View itihask56's full-sized avatar
🎯
Focusing

Itihas Verma itihask56

🎯
Focusing
View GitHub Profile
@hiteshchoudhary
hiteshchoudhary / tailwind.config.ts
Created February 9, 2024 08:26
Tailwind Plugins
// 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,
});