Skip to content
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

Server Components missing parent's scoped styles #27429

Closed
94726 opened this issue Jun 2, 2024 · 1 comment · Fixed by #27497
Closed

Server Components missing parent's scoped styles #27429

94726 opened this issue Jun 2, 2024 · 1 comment · Fixed by #27497

Comments

@94726
Copy link
Contributor

94726 commented Jun 2, 2024

Environment


  • Operating System: Linux
  • Node Version: v21.3.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: pnpm@9.1.4
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-mwjswz?file=app.vue

Describe the bug

When having a component with scoped styles and a servercomponent within, the servercomponent's root-element won't have the appropriate scopeId to get targeted by the scoped styles

Additional context

With regular components, scoped styles get applied to immediate children.

As packages/nuxt/src/components/runtime/server-components.ts is the immediate component, it probably has to pass it's scopeId down to the NuxtIsland, using getCurrentInstance().vnode.scopeId

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants