From 341d04b643929fcb893a2d57c073cc03d3044b1d Mon Sep 17 00:00:00 2001 From: Justin <68541335+TheAyes@users.noreply.github.com> Date: Fri, 20 Dec 2024 00:01:36 +0100 Subject: [PATCH] [feat] Add an option to disable the glide plugin theme system (#113) * Feat: Added an option to disable all recoloring * Fixes --------- Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com> --- src/equicordplugins/glide/index.tsx | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/equicordplugins/glide/index.tsx b/src/equicordplugins/glide/index.tsx index 6b31fee86..34ac52bec 100644 --- a/src/equicordplugins/glide/index.tsx +++ b/src/equicordplugins/glide/index.tsx @@ -142,6 +142,11 @@ const settings = definePluginSettings({ default: "0.2", onChange: injectCSS }, + colorsEnabled: { + type: OptionType.BOOLEAN, + description: "Whether or not to enable theming", + onChange: () => injectCSS() + }, ColorPreset: { type: OptionType.SELECT, description: "Some pre-made color presets (more soon hopefully)", @@ -318,13 +323,15 @@ function getCSS(fontName) { { --animspeed: ${Settings.plugins.Glide.animationSpeed + "s"}; --font-primary: ${(fontName.length > 0 ? fontName : "Nunito")}; - --accent: #${Settings.plugins.Glide.Accent}; - --bgcol: #${Settings.plugins.Glide.Primary}; - --text: #${Settings.plugins.Glide.Text}; - --brand: #${Settings.plugins.Glide.Brand}; - --mutedtext: ${mute(Settings.plugins.Glide.Text, 20)}; - --mutedbrand: ${mute(Settings.plugins.Glide.Brand, 10)}; - --mutedaccent: ${mute(Settings.plugins.Glide.Accent, 10)}; + ${Settings.plugins.Glide.colorsEnabled ? ` + --accent: #${Settings.plugins.Glide.Accent}; + --bgcol: #${Settings.plugins.Glide.Primary}; + --text: #${Settings.plugins.Glide.Text}; + --brand: #${Settings.plugins.Glide.Brand}; + --mutedtext: ${mute(Settings.plugins.Glide.Text, 20)}; + --mutedbrand: ${mute(Settings.plugins.Glide.Brand, 10)}; + --mutedaccent: ${mute(Settings.plugins.Glide.Accent, 10)}; + ` : ""} } :root { @@ -341,7 +348,7 @@ function getCSS(fontName) { /*COLOR ASSIGNING (most of these probably effect more than whats commented)*/ - + ${Settings.plugins.Glide.colorsEnabled ? ` /*accent based*/ /*buttons*/ @@ -546,7 +553,7 @@ function getCSS(fontName) { .unread_d8bfb3 { background-color: var(--text) !important; - } + }` : ""} /*ROUNDING (rounding)*/ @@ -642,7 +649,7 @@ function getCSS(fontName) { } /*Hide icon on file uploading status*/ - .icon_b52bef + .icon_f46c86 { display: none; }