From 6c77d51e2ad8e1e606425cb5aadbe34982946a46 Mon Sep 17 00:00:00 2001 From: FlorianWoelki Date: Sun, 2 Jun 2024 10:54:10 +0200 Subject: [PATCH] fix(lib): issue with custom color icon when changing font size (#498) --- src/lib/util/style.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/util/style.ts b/src/lib/util/style.ts index 6305d14e..6799dce1 100644 --- a/src/lib/util/style.ts +++ b/src/lib/util/style.ts @@ -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; + } } } });