Vue doesn't work correctly with dark classes in Tailwind 3.3
Vue version
3.2.41
Link to minimal reproduction
https://github.com/remiconnesson/tailwind-vue-deep-apply-dark-bug
Steps to reproduce
Reproduction already exists in https://github.com/tailwindlabs/tailwindcss/issues/11024
What is expected?
Vue correctly converts deep selectors inside scoped CSS
What is actually happening?
For example it gets converted like this
.dark .wrapper-without-is[data-v-472cff63] .child-text {
color: blue;
}
instead of this:
:is(.dark .wrapper[data-v-472cff63] .child-text) {
color: blue;
}
System Info
No response
Any additional comments?
I am reposting this from the issue opened in TailwindCSS - https://github.com/tailwindlabs/tailwindcss/issues/11024. Their team has said it's a Vue issue and they were planning on opening a bug report, but they never did. This issue has persisted for awhile and makes it impossible to upgrade, hence why I am opening it now
@Shyam-Chen AFIK UnoCSS doesn't have this issue - only TailwindCSS on it's own (it was mentioned somewhere as I was reading through, will find the source)
Hey in this reply https://github.com/tailwindlabs/tailwindcss/issues/11024#issuecomment-1513283412 there's a link to repro that doesn't use tailwindcss at all.
<template>
<div>
<div class="wrapper">
<div class="child-text">test</div>
</div>
<div class="dark">
<div class="wrapper">
<div class="child-text">test</div>
</div>
<div class="wrapper-without-is">
<div class="child-text">test</div>
</div>
</div>
</div>
</template>
<style scoped>
.wrapper :deep(.child-text) {
color: red;
}
:is(.dark .wrapper :deep(.child-text)) {
color: blue;
}
.dark .wrapper-without-is :deep(.child-text) {
color: blue;
}
</style>
results in