From b4506130f9405cf61538e639fe9b0306f5372c17 Mon Sep 17 00:00:00 2001 From: Niklas Choinowski Date: Tue, 18 Mar 2025 21:03:59 +0100 Subject: [PATCH 1/2] fix: use current value instead of initial to not override already set settings Co-Authored: @PhoenixGamer339 --- src/scss/style.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/style.ts b/src/scss/style.ts index 6248517..3e09483 100644 --- a/src/scss/style.ts +++ b/src/scss/style.ts @@ -55,7 +55,7 @@ async function extractMatugenizedVariables(matugenColors: MatugenColors): Promis continue; } - const initialValue = opt.initial; + const initialValue = opt.value ?? opt.initial; if (!isHexColor(initialValue) && matugenColors !== undefined) { result.push(`$${name.replace('theme.', '').split('.').join('-')}: ${initialValue};`); From b9aa6854f6687bf97349482b0fa35c00eec04fdf Mon Sep 17 00:00:00 2001 From: Niklas Choinowski Date: Wed, 19 Mar 2025 06:54:48 +0100 Subject: [PATCH 2/2] fix: removed opt.initial becouse opt.value will always hold either the user defined value or the default --- src/scss/style.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scss/style.ts b/src/scss/style.ts index 3e09483..80da46d 100644 --- a/src/scss/style.ts +++ b/src/scss/style.ts @@ -55,14 +55,14 @@ async function extractMatugenizedVariables(matugenColors: MatugenColors): Promis continue; } - const initialValue = opt.value ?? opt.initial; + const value = opt.value; - if (!isHexColor(initialValue) && matugenColors !== undefined) { - result.push(`$${name.replace('theme.', '').split('.').join('-')}: ${initialValue};`); + if (!isHexColor(value) && matugenColors !== undefined) { + result.push(`$${name.replace('theme.', '').split('.').join('-')}: ${value};`); continue; } - const matugenColor = getMatugenHex(initialValue as HexColor, matugenColors); + const matugenColor = getMatugenHex(value as HexColor, matugenColors); result.push(`$${name.replace('theme.', '').split('.').join('-')}: ${matugenColor};`); }