2 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 customElements
.define("custom-element", class extends HTMLElement
{
8 const template
= document
.getElementById("template");
9 const shadowRoot
= this.attachShadow({mode
: "open"})
10 .appendChild(template
.content
.cloneNode(true));
16 <template id=
"template">
18 .a + .b { color: green; }
20 <span class=
"a"></span>
21 <span class=
"b">This should be green
</span>
24 <custom-element id=
"foo"></custom-element>