Shadow DOM
ELI5 — The Vibe Check
Shadow DOM is like a force field around your component's internals. Styles can't leak in, styles can't leak out, and nobody can mess with your DOM from outside. It's the introvert's dream of CSS isolation. Your component's styles are none of the page's business.
Real Talk
Shadow DOM is a web standard that provides DOM and CSS encapsulation for components. It creates a separate DOM tree (shadow tree) attached to an element, with scoped styles that don't affect or get affected by the outer document, enabling true component isolation.
When You'll Hear This
"Shadow DOM gives you real CSS isolation, not the CSS Modules fake kind" / "Styling Shadow DOM from outside is intentionally hard"
Related Terms
CSS Modules
CSS Modules are like giving every CSS class a unique ID badge so they never clash with each other.
Lit
Lit is Google's way of saying 'Web Components don't have to be painful.
Web Components
Web Components are the browser's native component system. Custom elements, shadow DOM, templates - no framework needed.