You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Theme{static #a={};static #activates=[document];static #b=null;static addDocument(_doc){this.#activates.push(_doc)};static set theme(t){this.#b=t,this.#activates.forEach(act => this.#a[t].activate(act))}static get currentTheme(){return this.#b?this.#a[this.#b]:null}static get themes(){return this.#a}static storeTheme(t){this.#a[t.name]=t}constructor(t,e){this.theme=e,this.name=t}activate(_doc=document){Object.keys(this.theme).forEach(t=>_doc.querySelector(":root").style.setProperty(Theme.toCss(t),this.theme[t]))}toString(){return`${this.name}${JSON.stringify(this.theme)}`}static toCss(t){return"--"+t.replaceAll(" ","-")}}