diff options
author | V <vendicated@riseup.net> | 2023-07-08 03:13:32 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-07-08 03:13:32 +0200 |
commit | 2a318e390e77f8269fcba45ab9a0fd7008ca8d0a (patch) | |
tree | 51f32918ba6b929a2e29ef0cd502ca0dec0dd814 /src/utils | |
parent | 7c7723bfb18270f4410d0a2373a686a98e2a256f (diff) | |
download | Vencord-2a318e390e77f8269fcba45ab9a0fd7008ca8d0a.tar.gz Vencord-2a318e390e77f8269fcba45ab9a0fd7008ca8d0a.tar.bz2 Vencord-2a318e390e77f8269fcba45ab9a0fd7008ca8d0a.zip |
QuickCss: Fix wrongly applying quickcss when editing while disabled
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/quickCss.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/utils/quickCss.ts b/src/utils/quickCss.ts index fe35a3c..0ce50e5 100644 --- a/src/utils/quickCss.ts +++ b/src/utils/quickCss.ts @@ -27,8 +27,12 @@ export async function toggle(isEnabled: boolean) { if (isEnabled) { style = document.createElement("style"); style.id = "vencord-custom-css"; - document.head.appendChild(style); - VencordNative.quickCss.addChangeListener(css => style.textContent = css); + document.documentElement.appendChild(style); + VencordNative.quickCss.addChangeListener(css => { + style.textContent = css; + // At the time of writing this, changing textContent resets the disabled state + style.disabled = !Settings.useQuickCss; + }); style.textContent = await VencordNative.quickCss.get(); } } else @@ -39,7 +43,7 @@ async function initThemes() { if (!themesStyle) { themesStyle = document.createElement("style"); themesStyle.id = "vencord-themes"; - document.head.appendChild(themesStyle); + document.documentElement.appendChild(themesStyle); } const { themeLinks } = Settings; |