export class ModalBox extends HTMLElement { connectedCallback() { const closeEl = this.shadowRoot!.querySelector(".close") as HTMLElement; closeEl.onclick = () => { this.shadowRoot!.host.remove(); }; } constructor() { super(); //FIXME: this styling goes as is as it's a JS string. That's a lot of unnecessary whitespaces over the wire. const modalHtml = `