A new way to implement and use Shadow DOM directly in HTML.
Published on Friday, February 17, 2023
Translated to: Español, Português
Jason is a Web DevRel focused on speed and the JS ecosystem.
Developer on the Chrome team
Table of contents
- Building a Declarative Shadow Root
- Component hydration
- One shadow per root
- Streaming is cool
- Parser-only
- Server-rendering with style
- Avoiding the flash of unstyled content
- Feature detection and browser support
- Polyfill
- Further reading
Declarative Shadow DOM is a web platform feature, currently in the standardization process. It is enabled by default in Chrome version 111.
Declarative Shadow DOM has been available since Chrome 90 and Edge 91, but it used an older non-standard attribute called shadowroot
instead of the standardized shadowrootmode
attribute.