-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Css :deep()
selector not working correctly with SSR
#25229
Comments
Start a new pull request in StackBlitz Codeflow. |
@CernyMatej can you try if this applies when using plain vue + ssr too? Best would be to reproduce it via this stackblitz. |
@manniL I already did, as stated in the description. The reproduction for plain vue + ssr is under the link to the nuxt reproduction. 😊 |
@CernyMatej Thanks 👍 |
Linked to #23785. Basically the two selectors have equal specificity and the the order of CSS inlined differs from the order in the CSS file. You can work around by increasing the specificity of your CSS selector. |
@danielroe I don't think this was fixed in #25749. Or am I overlooking something? Updated reproduction with Nuxt 3.10.2: |
The issue we fixed was in production. Vite still does have an issue in development, but that is not Nuxt - Nuxt renders We could start with https://stackblitz.com/github/nuxt-contrib/vue3-ssr-starter but it will need modifying to add rendering CSS links. |
Ah, I see. Well, I initially tried to reproduce it in Vue SSR as well, but I wasn't able to. https://stackblitz.com/edit/github-hhybci?file=src%2Fpages%2FHome.vue,src%2Fcomponents%2FFlashingSquare.vue I'm not sure which changes you're suggesting we make. |
Environment
Darwin
v20.9.0
3.9.1
3.10.0
2.8.1
pnpm@8.10.4
-
devtools
-
-
Reproduction
Not working (Nuxt): https://stackblitz.com/edit/github-a6umaw?file=app.vue,components%2FFlashingSquare.vue
Working (Vue SSR): https://stackblitz.com/edit/github-hhybci?file=src%2Fpages%2FHome.vue,src%2Fcomponents%2FFlashingSquare.vue
Describe the bug
When using the
:deep
CSS selector, the styles are not applied in the correct order during loading, causing them to be overwritten after the page loads. When I tried reproducing this issue in Vue SSR, it worked correctly.Additional context
Works fine with
ssr: false
Logs
No response
The text was updated successfully, but these errors were encountered: