From 98521bbb6831f1f04cf27326508b2af1faf4825c Mon Sep 17 00:00:00 2001 From: Jon Robson Date: Mon, 7 Oct 2024 15:35:31 -0700 Subject: [PATCH] Drop base20 icon class suffix Following the migration to Codex, icons do not need suffixes for their icons. If we merge this now, we don't need to worry about caching when working on Bug T266361. Bug: T266361 Change-Id: Iafeb21858c89df1af35660eb63889fa5335e2b34 --- includes/Menu/Entries/LanguageSelectorEntry.php | 2 +- includes/Menu/Entries/ProfileMenuEntry.php | 2 +- includes/Menu/PageActions/ToolbarBuilder.php | 4 ++-- includes/Skins/SkinMinerva.php | 8 ++++---- resources/skins.minerva.loggedin.styles/styles.less | 2 +- tests/phpunit/skins/SkinMinervaTest.php | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/includes/Menu/Entries/LanguageSelectorEntry.php b/includes/Menu/Entries/LanguageSelectorEntry.php index ae75c8301..76423b91f 100644 --- a/includes/Menu/Entries/LanguageSelectorEntry.php +++ b/includes/Menu/Entries/LanguageSelectorEntry.php @@ -56,7 +56,7 @@ class LanguageSelectorEntry implements IMenuEntry { $this->title = $title; $this->doesPageHaveLanguages = $doesPageHaveLanguages; $this->messageLocalizer = $messageLocalizer; - $this->icon = 'language-base20'; + $this->icon = 'language'; $this->label = $label; $this->classes = $classes; } diff --git a/includes/Menu/Entries/ProfileMenuEntry.php b/includes/Menu/Entries/ProfileMenuEntry.php index f63f41216..c0087b8b0 100644 --- a/includes/Menu/Entries/ProfileMenuEntry.php +++ b/includes/Menu/Entries/ProfileMenuEntry.php @@ -84,7 +84,7 @@ final class ProfileMenuEntry implements IProfileMenuEntry { $username = $this->user->getName(); return [ [ 'data-icon' => [ - 'icon' => 'userAvatar-base20', + 'icon' => 'userAvatar', ], 'label' => $this->customProfileLabel ?? $username, 'array-attributes' => [ diff --git a/includes/Menu/PageActions/ToolbarBuilder.php b/includes/Menu/PageActions/ToolbarBuilder.php index 769d81677..2253afe34 100644 --- a/includes/Menu/PageActions/ToolbarBuilder.php +++ b/includes/Menu/PageActions/ToolbarBuilder.php @@ -198,7 +198,7 @@ class ToolbarBuilder { ); $iconFallback = $key === 'viewsource' ? 'editLock' : 'edit'; $icon = $editAction['icon'] ?? $iconFallback; - $entry->setIcon( $icon . '-base20' ) + $entry->setIcon( $icon ) ->trackClicks( $key ) ->setTitle( $this->context->msg( 'tooltip-' . $id ) ) ->setNodeID( $id ); @@ -243,7 +243,7 @@ class ToolbarBuilder { $historyAction['href'], ); $icon = $historyAction['icon'] ?? 'history'; - $entry->setIcon( $icon . '-base20' ) + $entry->setIcon( $icon ) ->trackClicks( 'history' ); return $entry; } diff --git a/includes/Skins/SkinMinerva.php b/includes/Skins/SkinMinerva.php index c9d00b689..f41f1b336 100644 --- a/includes/Skins/SkinMinerva.php +++ b/includes/Skins/SkinMinerva.php @@ -181,7 +181,7 @@ class SkinMinerva extends SkinMustache { */ private function getNotificationFallbackButton(): array { return [ - 'icon' => 'bellOutline-base20', + 'icon' => 'bellOutline', 'href' => SpecialPage::getTitleFor( 'Mytalk' )->getLocalURL( [ 'returnto' => $this->getTitle()->getPrefixedText() ] ), @@ -260,7 +260,7 @@ class SkinMinerva extends SkinMustache { return $class !== 'oo-ui-icon-bellOutline'; } ); - $alert['icon'] = 'bellOutline-base20'; + $alert['icon'] = 'bellOutline'; return $alert; } @@ -357,7 +357,7 @@ class SkinMinerva extends SkinMustache { 'data-minerva-search-box' => $data['data-search-box'] + [ 'data-btn' => [ 'data-icon' => [ - 'icon' => 'search-base20', + 'icon' => 'search', ], 'label' => $this->msg( 'searchbutton' )->escaped(), 'classes' => 'skin-minerva-search-trigger', @@ -371,7 +371,7 @@ class SkinMinerva extends SkinMustache { ], 'data-minerva-main-menu-btn' => [ 'data-icon' => [ - 'icon' => 'menu-base20', + 'icon' => 'menu', ], 'tag-name' => 'label', 'classes' => 'toggle-list__toggle', diff --git a/resources/skins.minerva.loggedin.styles/styles.less b/resources/skins.minerva.loggedin.styles/styles.less index 4fffd512e..43f61dcfe 100644 --- a/resources/skins.minerva.loggedin.styles/styles.less +++ b/resources/skins.minerva.loggedin.styles/styles.less @@ -1,6 +1,6 @@ @import '../../minerva.less/minerva.variables.less'; -.minerva-icon.minerva-icon--bellOutline-base20 { +.minerva-icon.minerva-icon--bellOutline { .cdx-mixin-css-icon( @cdx-icon-bell-outline, @color-subtle); } diff --git a/tests/phpunit/skins/SkinMinervaTest.php b/tests/phpunit/skins/SkinMinervaTest.php index 29a10e60b..752985b40 100644 --- a/tests/phpunit/skins/SkinMinervaTest.php +++ b/tests/phpunit/skins/SkinMinervaTest.php @@ -435,7 +435,7 @@ class SkinMinervaTest extends MediaWikiIntegrationTestCase { ], ], 'data-icon' => [ - 'icon' => 'bellOutline-base20' + 'icon' => 'bellOutline' ], 'label' => 'Alerts (13)', ], @@ -448,7 +448,7 @@ class SkinMinervaTest extends MediaWikiIntegrationTestCase { 'class' => 'mw-list-item', 'array-links' => [ [ - 'icon' => 'bellOutline-base20', + 'icon' => 'bellOutline', 'array-attributes' => [ self::ATTRIBUTE_NOTIFICATION_HREF, self::ATTRIBUTE_NOTIFICATION_DATA_COUNTER_TEXT,