I am currently in the process of developing a component with vuejs and tailwindcss. I have run into an issue where the colors for the background and text are not being applied properly.
<template>
<div :class="[isDark ? `bg-${color}-900 text-white` : `bg-${color}-200 text-${color}-900`, 'p-4 rounded-md']">
<slot />
</div>
</template>
<script>
export default {
name: "TCard",
props: {
color: {
type: String,
default: "gray",
validator: function (value) {
return ["gray", "red", "yellow", "green", "blue", "indigo", "purple", "pink"].includes(value);
},
},
isDark: {
type: Boolean,
default: false
}
},
};
</script>