fancyButton = {
const style = new CSSStyleSheet();
style.replaceSync(`
:host {
font-size: var(--font-size-3);
font-style: italic;
border: dashed;
}
`);
class FancyButton extends HTMLButtonElement {
static define(tag = "fancy-button") {
const current = customElements.get(tag);
if (current) {
Object.assign(current.prototype, this.prototype);
} else {
customElements.define(tag, this, { extends: "button" });
}
}
connectedCallback() {
const shadowRoot = this.attachShadow({ mode: "open" });
shadowRoot.adoptedStyleSheets = [style];
this.replaceChildren(
"fancy "
);
}
}
FancyButton.define();
return { style, FancyButton };
}