Sascha Schulz
2024-01-15 1b66d357cecda646009620ce9ba9424a4fa39517
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class HelloSayerComponent extends HTMLElement {
    connectedCallback() {
        const shadowRoot = this.attachShadow({mode: "open"});
 
        shadowRoot.innerHTML = `
            <style>
                div {
                    background-color: coral;
                    color: white;
                }
            </style>
            <div>Hello!</div>
        `;
    }
}
 
window.customElements.define("hello-sayer", HelloSayerComponent);