Skip to content

Commit

Permalink
fix(lib): issue with custom color icon when changing font size (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWoelki committed Jun 2, 2024
1 parent a99ecfc commit 6c77d51
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib/util/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,20 @@ const refreshIconNodes = (
const pathValue = plugin.getData()[path];
const hasIndividualColor =
typeof pathValue === 'object' && pathValue.iconColor;
if (hasIndividualColor) {
return;
}

iconNode.innerHTML = applyStyles(
plugin,
iconNode.innerHTML,
iconNode,
);
if (hasIndividualColor) {
iconNode.style.color = pathValue.iconColor;
const colorizedInnerHtml = svg.colorize(
iconNode.innerHTML,
pathValue.iconColor,
);
iconNode.innerHTML = colorizedInnerHtml;
}
}
}
});
Expand Down

0 comments on commit 6c77d51

Please sign in to comment.