Skip to content

bug: serializeShadowRoot: 'scoped' renders incorrect, initial ::part() styling #6297

Closed

Description

@johnjenkins

Prerequisites

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.

Image

Expected Behavior

::part styles should apply on initial load to serializeShadowRoot: 'scoped' SSR components

System Info

Steps to Reproduce

Missing 'scoped' ssr styles

  • pnpm i
  • pnpm build
  • pnpm express

Code Reproduction URL

https://github.com/johnjenkins/stencil-start-m6opf9rg

Additional Information

No response

Activity

  1. added
    Bug: Validated
    on Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedHelp Wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions