::slotted
A pseudo-element used inside a Web Component (Shadow DOM) to style elements that have been 'slotted' into a <slot> tag from the light DOM.
Syntax
/* Usage Example */
/* Inside the shadow DOM of a custom element */
::slotted(img) {
/* Styles images that were passed into the component's slot */
border-radius: 50%;
max-width: 100px;
}
::slotted Browser support
Widely available
Since
2020 95% global usage
This feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.
50+
63+
10+
79+