mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-17 20:52:14 +00:00
80d734b4d2
In modern Vector, the language button that is placed inside the page header should appear near the footer, if the page is a Main page. This changes some CSS selectors to not depend on the language button having the `.mw-body-header` parent element. Bug: T276140 Change-Id: I97bf0c11d0321752d472ac4988618a1db92b7271
90 lines
2.4 KiB
Plaintext
90 lines
2.4 KiB
Plaintext
// The use of mixins.buttons requires @font-size-base to be defined for this to work in Storybook
|
|
@import '../../common/variables.less';
|
|
@import 'mediawiki.mixins.less';
|
|
|
|
// TODO: `#p-lang-btn` Can be changed to `.mw-portlet-lang` when languages-in-header is the default.
|
|
#p-lang-btn {
|
|
.box-sizing( border-box );
|
|
height: @height-lang-button;
|
|
|
|
.mw-ui-icon:before {
|
|
margin-right: 8px;
|
|
// Put icon on correct standard normal state color.
|
|
opacity: 0.87;
|
|
}
|
|
|
|
.vector-menu-heading {
|
|
// Special treatment for language button, based on Vector font-size
|
|
font-size: @font-size-base;
|
|
// avoid sub pixel rendering
|
|
line-height: 1.493em;
|
|
// reset padding styles in MenuDropdown.less with right padding for arrow.
|
|
padding: 4px 30px 4px 8px;
|
|
// Prevent select of span text "X languages"
|
|
user-select: none;
|
|
// Remove opacity on language button (it applies to more menu because of label color).
|
|
opacity: 1;
|
|
|
|
&:after {
|
|
top: 0;
|
|
}
|
|
}
|
|
|
|
.vector-menu-content {
|
|
top: auto;
|
|
left: auto;
|
|
right: -@border-width-base;
|
|
// align borders of open menu align with button
|
|
.box-sizing( border-box );
|
|
max-height: 65vh;
|
|
overflow: scroll;
|
|
border-top-width: 1px;
|
|
|
|
// Adds to the show/hide technique in MenuDropdown.less with
|
|
// display to prevent rendering and long scrolling on Main page
|
|
display: none;
|
|
|
|
li a {
|
|
font-size: inherit;
|
|
}
|
|
}
|
|
|
|
.vector-menu-checkbox:checked ~ .vector-menu-content {
|
|
display: block;
|
|
}
|
|
|
|
.after-portlet {
|
|
// ensure there is a visual separation between the language links and additional links.
|
|
margin-top: 10px;
|
|
}
|
|
}
|
|
|
|
// Disable border-radius when dropdown menu open
|
|
.client-nojs {
|
|
#p-lang-btn:hover .vector-menu-heading,
|
|
.vector-menu-checkbox:checked + .vector-menu-heading {
|
|
border-radius: 0;
|
|
}
|
|
}
|
|
|
|
// mw-body-header class can be removed when language button is the default.
|
|
// e.g. upon removal of SkinVector::isLanguagesInHeader
|
|
.client-js #p-lang-btn {
|
|
// The `.mw-interlanguage-selector` is toggled off through js if the
|
|
// `ext.uls.interface` module is not being loaded.
|
|
.mw-interlanguage-selector {
|
|
// Remove the ULS language icon provided by ext.uls.compactlinks.less as we
|
|
// are already providing no-js users an icon.
|
|
background-image: none;
|
|
}
|
|
|
|
// When the ext.uls.interface module is loaded, we hide the fallback menu and
|
|
// checkbox.
|
|
.vector-menu--hide-dropdown {
|
|
.vector-menu-checkbox,
|
|
.vector-menu-content {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|