From 0a0d817d1e7ac5dec0d353f64a2d94972933fc3b Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 19 Dec 2024 21:16:25 -0500 Subject: [PATCH] injectcss if glide is enabled --- src/equicordplugins/glide/index.tsx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/equicordplugins/glide/index.tsx b/src/equicordplugins/glide/index.tsx index 34ac52be..2007c730 100644 --- a/src/equicordplugins/glide/index.tsx +++ b/src/equicordplugins/glide/index.tsx @@ -243,18 +243,20 @@ function parseFontContent() { return fontName; } function injectCSS() { + if (Settings.plugins.Glide.enabled) { - const fontName = parseFontContent(); - const theCSS = getCSS(fontName); + const fontName = parseFontContent(); + const theCSS = getCSS(fontName); - var elementToRemove = document.getElementById("GlideStyleInjection"); - if (elementToRemove) { - elementToRemove.remove(); + let elementToRemove = document.getElementById("GlideStyleInjection"); + if (elementToRemove) { + elementToRemove.remove(); + } + const styleElement = document.createElement("style"); + styleElement.id = "GlideStyleInjection"; + styleElement.textContent = theCSS; + document.documentElement.appendChild(styleElement); } - const styleElement = document.createElement("style"); - styleElement.id = "GlideStyleInjection"; - styleElement.textContent = theCSS; - document.documentElement.appendChild(styleElement); } function getCSS(fontName) { @@ -528,7 +530,7 @@ function getCSS(fontName) { background-color: var(--primary); } ${settings.store.pastelStatuses ? - ` + ` /*Pastel statuses*/ rect[fill='#23a55a'], svg[fill='#23a55a'] { fill: #80c968 !important;