From ef194424e3c7ae9355db68713be589c1cc2b438c Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:42:02 -0800 Subject: [PATCH] support css variables in sanitize --- src/renderer/utils/sanitize.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/renderer/utils/sanitize.ts b/src/renderer/utils/sanitize.ts index eb35d6289..5fba1988a 100644 --- a/src/renderer/utils/sanitize.ts +++ b/src/renderer/utils/sanitize.ts @@ -23,6 +23,9 @@ const addStyles = (output: string[], styles: CSSStyleDeclaration) => { } else if (typeof value === 'number') { output.push(`${key}:${value}${priorityString};`); } + } else if (styles.getPropertyValue(key)) { + // These will not override the value unless not declared !important + output.push(`${key}: ${styles.getPropertyValue(key)} !important;`); } } };