[Vuejs]-Tailwind css Classes are not included if they are type in a string vue

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.

Tailwind docs state:

enter image description here

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>

Leave a comment