Merge pull request #4020 from crazyserver/MOBILE-4456

MOBILE-4456 icons: Fix branded icons not being correctly coloured
main
Noel De Martin 2024-04-25 09:47:12 +02:00 committed by GitHub
commit 2b05e320ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -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<void> {
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;
}