From adde24e410573cf8f34dcffda69daff11f0b68d6 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Thu, 6 Feb 2025 21:14:47 -0700 Subject: [PATCH] Cleanup the mixin and remove the style caching since it stopped working somehow --- .../elements/mixins/StyledShadowElement.mjs | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/module/Apps/elements/mixins/StyledShadowElement.mjs b/module/Apps/elements/mixins/StyledShadowElement.mjs index 5eb6894..75de31b 100644 --- a/module/Apps/elements/mixins/StyledShadowElement.mjs +++ b/module/Apps/elements/mixins/StyledShadowElement.mjs @@ -24,12 +24,6 @@ export function StyledShadowElement(Base) { /** @type {ShadowRoot} */ _shadow; - /** - * The hook ID for this element's CSS hot reload - * @type {number} - */ - #cssHmr; - constructor() { super(); @@ -49,24 +43,16 @@ export function StyledShadowElement(Base) { disconnectedCallback() { if (!this.#mounted) { return }; - if (this.#cssHmr != null) { - Hooks.off(`dd-hmr:css`, this.#cssHmr); - this.#cssHmr = null; - }; this.#mounted = false; }; _getStyles() { - if (this.constructor._styles) { - this._style.innerHTML = this.constructor._styles; - } else { - fetch(`./systems/${game.system.id}/templates/${this.constructor._stylePath}`) - .then(r => r.text()) - .then(t => { - this.constructor._styles = t; - this._style.innerHTML = t; - }); - } + // TODO: Cache the CSS content in a more sane way that doesn't break + fetch(`./systems/${game.system.id}/templates/${this.constructor._stylePath}`) + .then(r => r.text()) + .then(t => { + this._style.innerHTML = t; + }); }; }; };