From 7f0ceb5c7acaa60e05e0377d1021fb1436a75b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 11 Apr 2024 11:41:31 +0200 Subject: [PATCH 1/2] MOBILE-4437 icon: Check branded icons checking filtericon url param --- src/core/components/mod-icon/mod-icon.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/components/mod-icon/mod-icon.ts b/src/core/components/mod-icon/mod-icon.ts index 3428e0026..a70c6862a 100644 --- a/src/core/components/mod-icon/mod-icon.ts +++ b/src/core/components/mod-icon/mod-icon.ts @@ -92,7 +92,6 @@ export class CoreModIconComponent implements OnInit, OnChanges { this.modNameTranslated = CoreCourse.translateModuleName(this.modname, this.fallbackTranslation); - this.setIsBranded(); this.setPurposeClass(); await this.setIcon(); @@ -113,7 +112,7 @@ export class CoreModIconComponent implements OnInit, OnChanges { * @returns wether the icon does not need to be filtered. */ protected async setIsBranded(): Promise { - if (!this.colorize || this.isBranded !== undefined) { + if (!this.colorize) { // It doesn't matter. return; } @@ -127,7 +126,6 @@ export class CoreModIconComponent implements OnInit, OnChanges { // No icon or local icon (not legacy), colorize it. if (!this.iconUrl || this.isLocalUrl) { - // Exception for bigbluebuttonbn, it's the only one that has a branded icon. if (this.iconVersion === IconVersion.VERSION_4_0 && this.modname === 'bigbluebuttonbn') { this.isBranded = true; @@ -174,6 +172,7 @@ export class CoreModIconComponent implements OnInit, OnChanges { if (!this.iconUrl) { this.loadFallbackIcon(); + this.setIsBranded(); return; } @@ -189,6 +188,8 @@ export class CoreModIconComponent implements OnInit, OnChanges { !this.isLocalUrl && this.getComponentNameFromIconUrl(this.iconUrl) != this.modname; + this.setIsBranded(); + await this.setSVGIcon(); } From 93f513c5316ea43b25a7882e2d9872106264c3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 11 Apr 2024 11:41:53 +0200 Subject: [PATCH 2/2] MOBILE-4437 icon: Fix icon styles without purpose on 4.0 version --- src/core/components/mod-icon/mod-icon.scss | 9 +++++---- 1 file 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 349c4b7d0..1732ef54b 100644 --- a/src/core/components/mod-icon/mod-icon.scss +++ b/src/core/components/mod-icon/mod-icon.scss @@ -37,11 +37,12 @@ &.version_40 { background-color: var(--gray-100); - --color: white; - @each $type, $value in $activity-icon-background-colors { &.#{$type}:not(.branded) { background-color: var(--activity-40-#{$type}); + ::ng-deep svg, img { + filter: brightness(0) invert(1); + } } } } @@ -56,10 +57,10 @@ --padding-bottom: var(--module-legacy-icon-padding, 8px); } - &:not(.branded) { + &.version_current:not(.branded) { ::ng-deep svg, ::ng-deep svg * { - fill: var(--color); + fill: var(--color) !important; } }