From 9a71c4de129a0959a81ccbcfdb727156eb4f0057 Mon Sep 17 00:00:00 2001 From: Mega-Volti <119437326+Mega-Volti@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:57:38 +0200 Subject: [PATCH] Update resolvedicon.jsx Remove unnecessary variable, restoring the fallback code in case no custom icon color is provided. --- src/components/resolvedicon.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/resolvedicon.jsx b/src/components/resolvedicon.jsx index 87df3c85..f4314423 100644 --- a/src/components/resolvedicon.jsx +++ b/src/components/resolvedicon.jsx @@ -57,10 +57,8 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log /> ); }; + // default to theme setting if no custom icon color code is provided - const iconColor = settings.iconStyle === "theme" ? - `rgb(var(--color-${ theme === "dark" ? 300 : 900 }) / var(--tw-text-opacity, 1))` : - "linear-gradient(180deg, rgb(var(--color-logo-start)), rgb(var(--color-logo-stop)))"; const iconName = icon.replace(`${prefix}-`, "").replace(".svg", ""); const iconSource = `${iconSetURLs[prefix]}${iconName}.svg`; return ( @@ -70,7 +68,9 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log height, maxWidth: '100%', maxHeight: '100%', - background: `${iconColor}`, + background: settings.iconStyle === "theme" ? + `rgb(var(--color-${ theme === "dark" ? 300 : 900 }) / var(--tw-text-opacity, 1))` : + "linear-gradient(180deg, rgb(var(--color-logo-start)), rgb(var(--color-logo-stop)))", mask: `url(${iconSource}) no-repeat center / contain`, WebkitMask: `url(${iconSource}) no-repeat center / contain`, }}