Skip to content

bug: missing scoped styles when component is included within a shadowRoot #6288

@johnjenkins

Description

@johnjenkins

Prerequisites

Stencil Version

latest

Current Behavior

  • Generate 2 shadow: true components: menu / nav-item
  • menu uses nav-item internally but nav-item can be used independently
  • use mixed SSR rendering: menu-item scoped, menu DSD
  • render both on a page

Given this setup, only the nav-item within menu will have any style; the nav-item's <style> tag only gets added to the menu's shadowRoot - not globally too.

If you remove the menu from the page, the nav-item's <style> is added globally and renders as expected

With the DSD element:

Image

Without:

Image

Expected Behavior

The scoped SSR component's <style> tag should be added both globally and to the DSD shadowRoot

System Info

Steps to Reproduce

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

  • pnpm i
  • pnpm build
  • pnpm express

Code Reproduction URL

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

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within StencilHelp Wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions