Merge pull request #3979 from crazyserver/MOBILE-4456

MOBILE-4456 icons: Do not apply colors if svg has styles
main
Alfonso Salces 2024-03-15 12:33:25 +01:00 committed by GitHub
commit e6ce19a91a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -354,6 +354,11 @@ export class CoreModIconComponent implements OnInit, OnChanges {
scripts[i].parentNode?.removeChild(scripts[i]);
}
// Has own styles, do not apply colors.
if (doc.documentElement.getElementsByTagName('style').length > 0) {
this.isBranded = true;
}
// Recursively remove attributes starting with on.
const removeAttributes = (element: Element): void => {
Array.from(element.attributes).forEach((attr) => {