class MainWindow extends HTMLElement { static observedAttributes = ['title', 'description']; constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { this.render(); } attributeChangedCallback() { this.render(); } render() { this.shadowRoot.innerHTML = `

${title}

${description}

`; } } customElements.define('main-window', MainWindow);