Y
Hacker News
new
|
ask
|
show
|
jobs
by
jakelazaroff
327 days 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-f...
In Tailwind you could probably replicate this with custom variants or whatever they're called.