-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in 3.3 @apply dark:
doesn't work anymore with vue :deep(.child-class)
#11024
Comments
@thecrypticace do you think this will already be solved by: #10943 & #10962? |
@RobinMalfait Nah this is a Vue issue, we can reproduce it without using Tailwind at all. We're in the middle of researching some workarounds to recommend in the mean time, should have something some time today 👍 |
Hey, this is happening because we now use the We've done some poking around and it appears that Vue isn't handling Here's an example with Vue and raw CSS that doesn't work like I'd expect: Here you can see the styles are: .wrapper[data-v-472cff63] .child-text {
color: red;
}
[data-v-472cff63]:is(.dark .wrapper :deep(.child-text)) {
color: blue;
}
.dark .wrapper-without-is[data-v-472cff63] .child-text {
color: blue;
} Where you'd expect the 2nd selector to be this instead: :is(.dark .wrapper[data-v-472cff63] .child-text) {
color: blue;
} So this isn't really an issue of In the meantime, you can work around this by using You can install it using module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
"@csstools/postcss-is-pseudo-class": {},
},
}; I've opened a PR against your reproduction repo to show you what this looks like in practice: remiconnesson/tailwind-vue-deep-apply-dark-bug#1 Let me know if you have any more questions! ✨ |
If this is a Vue issue, has anyone opened an issue in Vue.js on this? Been trying to find something, but can't - it would be good for Vue to fix this issue, rather than having to use a workaround. For now, it seems I am blocked form upgrading Tailwind |
You mentioned you were going to open an issue on this - if you haven't done it so far, should I go ahead and open it myself with a link to this issue? |
Issue opened on Vue ^. Appreciate additional contributions on there to get the ball rolling |
Here's a relevant PR someone has opened to fix this in Vue, just to connect the dots here: |
What version of Tailwind CSS are you using?
v3.3.1
What build tool (or framework if it abstracts the build tool) are you using?
vite4 and vite3 (happened with both)
What version of Node.js are you using?
v19.1.0
What browser are you using?
Chrome
What operating system are you using?
WSL2 ubuntu 22
Reproduction URL
https://github.com/remiconnesson/tailwind-vue-deep-apply-dark-bug
Describe your issue
hello,
tailwincss is set in
darkMode: "class"
and we are usinguseDark
fromvueUse
to add and remove the dark class.in
App.vue
we have a child componenttargeting
@/components/ChildText.vue
but the
dark:
modifier doesn't work in3.3
when it used it work in3.2
as shown in the screenshot below
@3.3
, in the repro, one line of text should be yellow but is pink instead@3.2
we observe the correct behaviorP.S: in
App.vue
we show that the dark modifier do work with
apply
+dark:
does work for elements in the same SFC inside a scoped style blockapply
+dark:
does work inside a global style blockP.P.S: As stated in the vue doc here
https://vuejs.org/api/sfc-css-features.html#scoped-css
vue transforms this
into this
so this issue might not be only related to an interaction vuejs
The text was updated successfully, but these errors were encountered: