Merge "Remove .mw-ui-button styles from user-links overflow menu"

This commit is contained in:
jenkins-bot 2022-08-10 07:39:39 +00:00 committed by Gerrit Code Review
commit 310bf970bd
3 changed files with 18 additions and 16 deletions

View file

@ -290,7 +290,8 @@ class Hooks implements
if ( isset( $content_navigation['user-page']['userpage'] ) ) { if ( isset( $content_navigation['user-page']['userpage'] ) ) {
$content_navigation[$overflow]['userpage'] = array_merge( $content_navigation[$overflow]['userpage'] = array_merge(
$content_navigation['user-page']['userpage'], [ $content_navigation['user-page']['userpage'], [
'button' => true, // T312157: Style the userpage link as a blue link rather than a quiet button.
'button' => false,
'collapsible' => true, 'collapsible' => true,
// Remove icon // Remove icon
'icon' => '', 'icon' => '',
@ -320,7 +321,8 @@ class Hooks implements
$content_navigation[$overflow]['createaccount'] = array_merge( $content_navigation[$overflow]['createaccount'] = array_merge(
$content_navigation['user-menu']['createaccount'], [ $content_navigation['user-menu']['createaccount'], [
'id' => 'pt-createaccount-2', 'id' => 'pt-createaccount-2',
'button' => true, // T312157: Style the userpage link as a blue link rather than a quiet button.
'button' => false,
'collapsible' => true, 'collapsible' => true,
// Remove icon // Remove icon
'icon' => '', 'icon' => '',

View file

@ -1,8 +1,11 @@
@import '../../common/variables.less'; @import '../../common/variables.less';
@import '../../common/mixins.less'; @import '../../common/mixins.less';
@import 'mediawiki.mixins.less'; @import 'mediawiki.mixins.less';
@import 'mediawiki.ui/variables.less';
@font-size-user-links: unit( 14 / @font-size-browser, em ); // Equals `0.875em`. @font-size-user-links: unit( 14 / @font-size-browser, em ); // Equals `0.875em`.
// Applies to links in the overflow menu that do not have the .mw-ui-button class.
@overflow-link-margin: 0 8px;
/** /**
* Container that holds both the horizontal menu and dropdown menus. * Container that holds both the horizontal menu and dropdown menus.
@ -57,6 +60,11 @@
align-items: center; align-items: center;
} }
// Add margin to links that don't have the .mw-ui-button or related icon classes.
a:not( .mw-ui-button ):not( .mw-echo-notifications-badge ) {
margin: 0 8px;
}
.user-links-collapsible-item { .user-links-collapsible-item {
@media ( max-width: @max-width-mobile ) { @media ( max-width: @max-width-mobile ) {
display: none; display: none;
@ -108,10 +116,15 @@
border-top: @border-width-base @border-style-base @colorGray14; border-top: @border-width-base @border-style-base @colorGray14;
} }
//User-page link in personal (dropdown) menu. //User-page link in personal (overflow) menu.
#pt-userpage-2 { #pt-userpage-2 {
max-width: unit( 155 / @font-size-browser / @font-size-user-links, em ); max-width: unit( 155 / @font-size-browser / @font-size-user-links, em );
a {
// T312157 Override redlink (.new) color for non-existant userpage
color: @color-primary;
}
span { span {
.text-overflow( @visible: false ); .text-overflow( @visible: false );
} }

View file

@ -451,11 +451,6 @@ class VectorHooksTest extends MediaWikiIntegrationTestCase {
$this->assertFalse( isset( $contentNav['user-page']['login'] ), $this->assertFalse( isset( $contentNav['user-page']['login'] ),
'updateUserLinksDropdownItems is called when not legacy' 'updateUserLinksDropdownItems is called when not legacy'
); );
$this->assertContains( 'mw-ui-button',
$contentNav['vector-user-menu-overflow']['userpage']['link-class'],
'updateUserLinksOverflowItems is called when not legacy'
);
Hooks::onSkinTemplateNavigation( $vectorLegacySkin, $contentNavLegacy ); Hooks::onSkinTemplateNavigation( $vectorLegacySkin, $contentNavLegacy );
$this->assertFalse( isset( $contentNavLegacy['user-page'] ), $this->assertFalse( isset( $contentNavLegacy['user-page'] ),
'user-page is unset for legacy vector' 'user-page is unset for legacy vector'
@ -564,14 +559,6 @@ class VectorHooksTest extends MediaWikiIntegrationTestCase {
$content['vector-user-menu-overflow']['userpage']['class'], $content['vector-user-menu-overflow']['userpage']['class'],
'User page link in user links overflow requires collapsible class' 'User page link in user links overflow requires collapsible class'
); );
$this->assertContains( 'mw-ui-button',
$content['vector-user-menu-overflow']['userpage']['link-class'],
'User page link in user links overflow requires button classes'
);
$this->assertContains( 'mw-ui-quiet',
$content['vector-user-menu-overflow']['userpage']['link-class'],
'User page link in user links overflow requires quiet button classes'
);
$this->assertNotContains( 'mw-ui-icon', $this->assertNotContains( 'mw-ui-icon',
$content['vector-user-menu-overflow']['userpage']['class'], $content['vector-user-menu-overflow']['userpage']['class'],
'User page link in user links overflow does not have icon classes' 'User page link in user links overflow does not have icon classes'