Skip to content

[specificity] Specifity of ::slotted() is greater than :host #2290

@gavinmcfarland

Description

@gavinmcfarland

If you declare styles inside a component which use the :slotted() selector then styles applied by any child components which are uses inside that component cannot be overridden using :host.

/* Parent custom element */
:slotted(*) {
    color: green;
}

/* Child custom element */
:host {
    color: red;
}

I would expect the child custom element's text to be red, but it is in fact green.

http://jsbin.com/cecuxad/edit?html,console,output

Is there anything in the spec that covers this behaviour?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions