-
|
I am running a standalone version of the 4.1 compiler : How do I get the tailwindcss compiler to detect this AlpineJS variable ? :class="`text-sm text-[#${item.color}]`"I had to resort to this to pre-define the color shades in a hidden DIV. <div class="hidden">
<div class="text-[#26BBE3]"></div>
<div class="text-[#4CD7C1]"></div>
<div class="text-[#F7847B]"></div>
</div>
<script>
let reasons = [
{ category: "fruit", color: "26BBE3" },
{ category: "vegetable", color: "4CD7C1" },
{ category: "meat", color: "F7847B" },
];
</script>
<div x-data="{reasons: reasons}">
<template x-for="(item, index) in reasons">
<div x-text="item.category" :class="`text-sm text-[#${item.color}]`"></div>
</template>
</div>I understand the answer is to use inline styles instead, but am just wondering alternate approaches. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
As per the documentation:
|
Beta Was this translation helpful? Give feedback.
As per the documentation: