mediawiki-skins-Vector/resources/skins.vector.styles/components/UserMenu.less
jdlrobson 6998c536d4 Both UserMenu stylesheets should be shipped in modern
Since we have feature flagged the new user menu feature, it is
imperative we load both sets of styles until the feature has
shipped. This allows us to switch seamlessly between the two
without worrying about cached HTML being served with updated CSS.

To do this, we add a new class to both user menu's distinguishing
the legacy version from the modern version. The styles are then
scoped to these new selectors.

This also fixes some regressions with the legacy user menu in
modern Vector when wgVectorConsolidateUserLinks is disabled.

Notes:
* No caching selector is needed for #pt-userpage given it can only
ever be output for logged in users.
* ID selectors in general are bad, so scoping to mw-portlet-personal-user-menu-legacy
isolates the legacy component allowing it to be rendered alongside the modern UserMenu

Bug: T276561
Change-Id: I068c5233bb25a7b141e66a6726b5761841f83eb2
2021-05-14 10:13:09 -07:00

65 lines
1.3 KiB
Plaintext

@import '../../common/variables.less';
// Overrides personal menu styles for consolidated user links.
.vector-user-menu.vector-menu-dropdown h3:after {
padding: 0.4em 0 0.4em 0;
content: none;
}
.vector-user-menu.vector-menu-dropdown {
.vector-menu-checkbox {
&:hover + h3 {
background-color: @colorGray14;
border-radius: @border-radius-base;
}
}
.vector-menu-content {
top: 100%;
left: unset;
right: 0;
}
.vector-menu-content-list {
justify-content: flex-start;
li {
// FIXME: the following font-size rule is for cached HTML. It can be removed when
// I068c5233bb25a7b141e66a6726b5761841f83eb2 is in production.
// stylelint-disable-next-line declaration-no-important
font-size: 100% !important;
width: 100%;
&:hover {
background-color: @colorGray14;
}
}
li#pt-logout {
border-top: 1px solid @border-color-base;
}
a,
&:hover,
&:visited {
color: #000;
text-decoration: none;
}
}
}
// Since user-page is pulled out of the personal menu for modern vector,
// apply styles for the top-level user-page menu.
// FIXME: This is currently not isolated to the UserMenu component
// as it is rendered separately outside the `.vector-user-menu` class.
#p-user-page {
li {
padding-bottom: 0.5em;
a {
background-position: left center;
padding-left: 1.5em;
}
}
}