mediawiki-skins-Vector/resources/skins.vector.styles/components/UserLinks.less

151 lines
3 KiB
Plaintext
Raw Normal View History

@import '../../common/variables.less';
.vector-user-links {
display: flex;
align-items: center;
position: relative;
justify-content: flex-end;
flex-shrink: 1;
.vector-user-menu-more {
.vector-menu-content-list {
display: flex;
align-items: center;
li {
padding-top: 0;
margin-left: 1em;
white-space: nowrap;
a {
color: #000;
text-decoration: none;
}
// Below tablet threshold, all menu items except the notification icons will collapse into the user menu
// This ensures a max of 4 icons on small screen sizes (i.e. search, 2 notification icons and the user avatar)
&.user-links-collapsible-item {
display: none;
@media ( min-width: @width-breakpoint-tablet ) {
display: block;
}
}
}
}
}
// Overrides personal menu styles for consolidated user links.
.vector-user-menu {
margin: 0 0 0 12px;
height: 100%;
h3 {
color: transparent; // overrides MediaWiki UI icon
height: 100%;
font-size: inherit;
}
.vector-menu-checkbox {
// FIXME: This variable is currently not available in mediawiki core, but defined in the icons specification.
@icon-background-color--selected: rgba( 0, 0, 0, 0.03 );
// The mw-ui-icon hover effect does not work on the checkbox hack so must be applied explicitly.
&:hover + h3 {
background-color: @icon-background-color--selected;
}
}
.vector-menu-content {
min-width: 200px;
top: 100%;
left: unset;
right: 0;
border-top-width: 1px;
}
.vector-menu-content-list {
li {
width: 100%;
margin: 0;
&:hover {
background-color: @background-color-secondary;
}
&.user-links-collapsible-item {
@media ( min-width: @width-breakpoint-tablet ) {
display: none;
}
}
}
a {
display: block;
color: #000;
text-decoration: none;
}
}
// Copied from https://github.com/wikimedia/Vector/blob/master/resources/common/components/MenuDropdown.less#L88
.vector-user-menu-anon-editor,
.vector-user-menu-login {
padding: 0.625em;
margin: 0;
p,
span {
font-size: @font-size-tabs;
}
}
// "Login" and "Logout" links in user menu
.vector-user-menu-login {
&:hover {
background-color: @background-color-secondary;
}
&:first-child {
border-bottom: 1px solid @border-color-base;
}
&:last-child {
border-top: 1px solid @border-color-base;
}
a {
display: block;
color: #000;
text-decoration: none;
}
}
}
.vector-user-menu-logged-out h3 {
&:before {
height: 100%;
}
&:after {
content: none;
}
}
.vector-user-menu-logged-in h3 {
// FIXME: Ideally this variable should be accessible from mediawiki.skin.variables
// Remove it when we can.
@icon-padding-md: unit( 12 / @font-size-browser, em );
@icon-arrow-size: unit( 12px / @font-size-browser, em );
padding-right: @icon-padding-md + @icon-arrow-size;
&:before {
color: #54595d;
}
&:after {
background-position: 100% 0%;
top: @icon-padding-md + ( @icon-arrow-size / 2 );
right: @icon-arrow-size;
}
}
}