Web Components, Shadow Dom, Web Standards, CSS, HTML.
Implementation With the high-level solution worked out, let’s look at an implementation for <shared-style>: const lookup = new Map(); class SharedStyle extends HTMLElement { connectedCallback() { const id = this.getAttribute("style-id"); const root = this.getRootNode(); let styles = lookup.get(id);