2👍
✅
Adding on to Markiesch, Tailwind suggests not writing classes this way as they are not recognised by the purger on build, which means the class as you wrote it will most likely not work in production.
2👍
The class is not applying because the browser doesnt understand the syntax bg-${color}-500
. Use the build-in Vue feature v-bind:class=""
or using the shorthand :
to make this work
<div :class="`bg-${color}-500`"> </div>
Source:stackexchange.com