From 4c3907e61d7499b375abe0abcf126f9a1d518230 Mon Sep 17 00:00:00 2001 From: Jdlrobson Date: Wed, 1 Sep 2021 15:35:05 +0000 Subject: [PATCH] Revert "Language button icon/button should be consistent with other buttons" This reverts commit 5ca2ccb58a5f50e900b30c01b746d92e4732c4ad. Reason for revert: Per Niklas's review (T289630#7324439) I've also seen a much better way to do this which limits the change to modern skins so I'll post a follow up shortly. Change-Id: I99802c60390e23eaa0de21462788da622a35a37a --- includes/UniversalLanguageSelectorHooks.php | 8 ++--- resources/css/ext.uls.pt.less | 34 +++++++-------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/includes/UniversalLanguageSelectorHooks.php b/includes/UniversalLanguageSelectorHooks.php index c6b89af1..f3fdf6de 100644 --- a/includes/UniversalLanguageSelectorHooks.php +++ b/includes/UniversalLanguageSelectorHooks.php @@ -132,10 +132,7 @@ class UniversalLanguageSelectorHooks { $out->addJsConfigVars( $config ); if ( $wgULSPosition === 'personal' ) { - $out->addModuleStyles( [ - 'mediawiki.ui.button', - 'ext.uls.pt' - ] ); + $out->addModuleStyles( 'ext.uls.pt' ); } else { $out->addModuleStyles( 'ext.uls.interlanguage' ); } @@ -229,8 +226,7 @@ class UniversalLanguageSelectorHooks { 'uls' => [ 'text' => Language::fetchLanguageName( $langCode ), 'href' => '#', - 'link-class' => 'mw-ui-icon mw-ui-icon-before', - 'class' => 'uls-trigger mw-ui-button mw-ui-quiet', + 'class' => 'uls-trigger', 'active' => true ] ] + $personal_urls; diff --git a/resources/css/ext.uls.pt.less b/resources/css/ext.uls.pt.less index fac66ef2..51202e02 100644 --- a/resources/css/ext.uls.pt.less +++ b/resources/css/ext.uls.pt.less @@ -19,29 +19,23 @@ * A hack to load the icon before the rest of the module is lazy-loaded. * Copied from jquery.uls.css with the path changed. */ -.uls-trigger a:before { +.uls-trigger { background: no-repeat url( ../../lib/jquery.uls/images/language.svg ) left center; + // Let the SVG image fit without cropping or stretch + background-size: contain; + padding-left: 24px; } -.vector-user-links { - .uls-trigger { - // Disable additional icon on load. - background-image: none; - // Can be removed when no longer need to override rule in jquery.uls.css - padding-left: 12px; - } -} - -// Vector modern = ca-uls -// Other skins = pt-uls #pt-uls { - .mw-ui-button { - display: inline; - padding: 0; - border: 0; - } + padding-top: 0 !important; // stylelint-disable-line declaration-no-important .uls-trigger { + background-image: none; + // Same values as Vector's `#p-personal li`. + display: inline-block; + padding-top: 0.5em !important; // stylelint-disable-line declaration-no-important + padding-left: 0; + // Putting the icon in before in order to apply `opacity`. &:before { content: ''; @@ -59,12 +53,6 @@ } } -.skin-vector { - #ca-uls span { - font-size: 0.875em; - } -} - /* Opera for some inexplicable reason confuses right and left padding with */ /* RTL text direction here (bug T47142). x:-o-prefocus won't match anything, */ /* but will make other browsers ignore this rule. */