9 ms·
Yeah, use CSS variables. I wrote a TIL on doing this exact thing (customizing a button's background color from outside) with vanilla CSS: https://til.jakelazaro
by jakelazaroff 1y ago
Yeah, use CSS variables. I wrote a TIL on doing this exact thing (customizing a button's background color from outside) with vanilla CSS: https://til.jakelazaroff.com/css/dynamically-change-styles-from-html-or-jsx/ https://til.jakelazaroff.com/css/dynamically-change-styles-f...
In Tailwind you could probably replicate this with custom variants or whatever they're called.