[bug?/v4] Cannot use @apply
in css module in Vue SFC
#17583
-
SummaryWe can't use Minimal Reproduction: https://github.com/kakkokari-gtyih/tailwind-v4-vue-module-repro DetailsAdam pointed out that As mentioned in Adam's reproduction, this works: <template>
<h2 class="scopedApplyClass text-2xl font-bold">The color of this text should be blue (--color-custom)</h2>
</template>
<style scoped>
@reference '../tailwind.css';
.scopedApplyClass {
@apply text-custom;
}
</style> However, this is not working: <template>
<h2 class="text-2xl font-bold" :class="$style.moduleApplyClass">The color of this text should be blue (--color-custom)</h2>
</template>
<style module>
@reference '../tailwind.css';
.moduleApplyClass {
@apply text-custom;
}
</style> |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Should I write this as issue as well? |
Beta Was this translation helpful? Give feedback.
-
Hi, it's been a while since I file this bug on discussion, and I haven't gotten any direction whether it should be moved to an issue or at least some insights. Thanks! |
Beta Was this translation helpful? Give feedback.
Seems like the build system doesn't use Vite plugins on CSS modules. This means the Tailwind CSS syntax doesn't get processed:
Furthermore, as per the documentation:
Also, Adam Wathan (creator of Tailwind) does seem to advocate avoiding
@apply
:Instead, consider writing all class names inline: