-
-
Notifications
You must be signed in to change notification settings - Fork 834
bug: serializeShadowRoot: 'scoped' renders incorrect, initial ::part() styling #6297
Copy link
Copy link
Closed
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within StencilHelp Wanted
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
latest
Current Behavior
CSS selectors using ::part() will fail within components rendered during SSR using serializeShadowRoot: 'scoped'.
This is because ::part() is a specific api to pierce shadow roots and because serializeShadowRoot: 'scoped' components are initially rendered without a shadow root, the selector fails.
In the attached example, the child component is ssr rendered with scoped. It's parent uses a ::part() selector to style the button, but it does not apply because the child doesn't yet have a shadow-root attached.
Expected Behavior
::part styles should apply on initial load to serializeShadowRoot: 'scoped' SSR components
System Info
Steps to Reproduce
Missing 'scoped' ssr styles
pnpm ipnpm buildpnpm express
Code Reproduction URL
https://github.com/johnjenkins/stencil-start-m6opf9rg
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within StencilHelp Wanted