Skip to content

bug: ::slotted(...) selector not working appropriately in scoped: true component #6081

@johnjenkins

Description

@johnjenkins

Prerequisites

Stencil Version

latest

Current Behavior

::slotted(...) selectors in scoped: true components are not working properly due to the css selector not having enough specificity.

image

This is due to a regression added via the recent client-hydrate re-write which incorrectly applies the internal / scoped className to the slotted elements *edit this has been true for a while in Stencil

image

Expected Behavior

slotted selectors should be applied to slotted nodes

System Info

No response

Steps to Reproduce

Open https://stackblitz.com/edit/stencil-start-ydmeww :

npm run build && npm run express

In the preview window, click on 'non-shadow-css-slotted'.

Notice the slotted node has the wrong colour.

Code Reproduction URL

https://stackblitz.com/edit/stencil-start-ydmeww

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions