From d4b52a424e1794fbf81afdc86b463e0b84b48e67 Mon Sep 17 00:00:00 2001 From: Barry Pollard Date: Wed, 25 Sep 2024 19:07:16 +0100 Subject: [PATCH] Limit data URLs in css-variables (#145) --- dist/css-variables.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/css-variables.js b/dist/css-variables.js index bc57282..53a54f8 100644 --- a/dist/css-variables.js +++ b/dist/css-variables.js @@ -46,6 +46,9 @@ function analyzeVariables() { for (let property of style) { let value = style.getPropertyValue(property); + if (value.startsWith("url(\"data:image/svg+xml") && value.length > 54) { + value = value.slice(0, 50) + '…' + "\");"; + } let containsRef = value.indexOf("var(--") > -1; let setsVar = property.indexOf("--") === 0 && property.indexOf("--" + PREFIX) === -1;