From 78c2db0c6d187645e0d52660e44d6bd1f8330689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 24 Apr 2024 14:12:24 +0200 Subject: [PATCH] MOBILE-4456 icons: Fix branded icons not being correctly coloured --- src/core/components/mod-icon/mod-icon.scss | 2 +- src/core/components/mod-icon/mod-icon.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/components/mod-icon/mod-icon.scss b/src/core/components/mod-icon/mod-icon.scss index 1732ef54b..d10806744 100644 --- a/src/core/components/mod-icon/mod-icon.scss +++ b/src/core/components/mod-icon/mod-icon.scss @@ -57,7 +57,7 @@ --padding-bottom: var(--module-legacy-icon-padding, 8px); } - &.version_current:not(.branded) { + &.colorize.version_current:not(.branded) { ::ng-deep svg, ::ng-deep svg * { fill: var(--color) !important; diff --git a/src/core/components/mod-icon/mod-icon.ts b/src/core/components/mod-icon/mod-icon.ts index a70c6862a..b9f3c1b7c 100644 --- a/src/core/components/mod-icon/mod-icon.ts +++ b/src/core/components/mod-icon/mod-icon.ts @@ -108,17 +108,18 @@ export class CoreModIconComponent implements OnInit, OnChanges { /** * Sets the isBranded property when undefined. - * - * @returns wether the icon does not need to be filtered. */ protected async setIsBranded(): Promise { if (!this.colorize) { + this.isBranded = false; + // It doesn't matter. return; } // Earlier 4.0, icons were never colorized. if (this.iconVersion === IconVersion.LEGACY_VERSION) { + this.isBranded = false; this.colorize = false; return; @@ -133,7 +134,7 @@ export class CoreModIconComponent implements OnInit, OnChanges { return; } - this.isBranded = false; + this.isBranded ??= false; return; }