Skip to content

Commit

Permalink
Limit data URLs in css-variables (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb authored Sep 25, 2024
1 parent a99e1f5 commit 4b6f43b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dist/css-variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ function walkRule(rule, ret) {

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;
Expand Down

0 comments on commit 4b6f43b

Please sign in to comment.