QuickCss: Fix wrongly applying quickcss when editing while disabled

main
V 1 year ago
parent 7c7723bfb1
commit 2a318e390e
No known key found for this signature in database
GPG Key ID: A1DC0CFB5615D905

@ -27,8 +27,12 @@ export async function toggle(isEnabled: boolean) {
if (isEnabled) { if (isEnabled) {
style = document.createElement("style"); style = document.createElement("style");
style.id = "vencord-custom-css"; style.id = "vencord-custom-css";
document.head.appendChild(style); document.documentElement.appendChild(style);
VencordNative.quickCss.addChangeListener(css => style.textContent = css); 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(); style.textContent = await VencordNative.quickCss.get();
} }
} else } else
@ -39,7 +43,7 @@ async function initThemes() {
if (!themesStyle) { if (!themesStyle) {
themesStyle = document.createElement("style"); themesStyle = document.createElement("style");
themesStyle.id = "vencord-themes"; themesStyle.id = "vencord-themes";
document.head.appendChild(themesStyle); document.documentElement.appendChild(themesStyle);
} }
const { themeLinks } = Settings; const { themeLinks } = Settings;

Loading…
Cancel
Save