[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>
This commit is contained in:
Justin 2024-12-20 00:01:36 +01:00 committed by GitHub
parent 5a01fde437
commit 341d04b643
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,6 +323,7 @@ function getCSS(fontName) {
{
--animspeed: ${Settings.plugins.Glide.animationSpeed + "s"};
--font-primary: ${(fontName.length > 0 ? fontName : "Nunito")};
${Settings.plugins.Glide.colorsEnabled ? `
--accent: #${Settings.plugins.Glide.Accent};
--bgcol: #${Settings.plugins.Glide.Primary};
--text: #${Settings.plugins.Glide.Text};
@ -325,6 +331,7 @@ function getCSS(fontName) {
--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;
}