Add a toggle component

This commit is contained in:
Oliver 2026-03-22 23:55:55 -06:00
parent 92553cb1f1
commit 6e2dfa1cf1
5 changed files with 165 additions and 3 deletions

View file

@ -26,10 +26,13 @@ export function StyledShadowElement(Base) {
/** @type {ShadowRoot} */
_shadow;
constructor() {
constructor({focusable = false} = {}) {
super();
this._shadow = this.attachShadow({ mode: `open` });
this._shadow = this.attachShadow({
mode: `open`,
delegatesFocus: focusable,
});
this._style = document.createElement(`style`);
this._shadow.appendChild(this._style);
};