DEV Community

Cover image for Shadow DOM API
sahra πŸ’«
sahra πŸ’«

Posted on

Shadow DOM API

This is a submission for DEV Challenge v24.03.20, One Byte Explainer: Browser API or Feature.

Explainer

The shadow DOM API creates an encapsulated DOM tree attached to an element in the actual DOM known as the shadow host.

The nodes in this tree are invisible to CSS and JS except when referenced by the shadowRoot property.

Additional Context

This allows you to create nodes without breaking elements in the actual DOM, which can be used to provide additional features to custom elements.

Top comments (0)