2021-02-08 23:10:21 +00:00
|
|
|
// The use of mixins.buttons requires @font-size-base to be defined for this to work in Storybook
|
2021-02-02 10:04:37 +00:00
|
|
|
@import '../../common/variables.less';
|
2022-09-29 22:54:55 +00:00
|
|
|
@import '../../common/mixins.less';
|
2021-03-22 22:59:18 +00:00
|
|
|
@import 'mediawiki.mixins.less';
|
2021-02-01 22:56:31 +00:00
|
|
|
|
2022-09-01 16:58:56 +00:00
|
|
|
// Note vector-feature-language-in-header-enabled class is not used here as that class
|
2022-07-06 14:53:26 +00:00
|
|
|
// only applies to main page.
|
2022-10-17 20:09:53 +00:00
|
|
|
// This must be limited to vector-page-titlebar as the mw-portlet-lang class is shared with
|
2022-07-06 14:53:26 +00:00
|
|
|
// the language portlet that can display in the sidebar.
|
2022-10-17 20:09:53 +00:00
|
|
|
.vector-page-titlebar .mw-portlet-lang {
|
2021-08-26 19:47:02 +00:00
|
|
|
// FIXME [review whether margin-top is needed] center vertically in heading.
|
2023-01-30 14:55:10 +00:00
|
|
|
// See also: `.vector-page-titlebar > .mw-ui-button` rule in PageTitlebar.less
|
2021-08-26 19:47:02 +00:00
|
|
|
margin-top: 2px;
|
2022-05-12 20:17:03 +00:00
|
|
|
box-sizing: border-box;
|
2022-07-20 14:32:24 +00:00
|
|
|
height: @height-button-lang;
|
2022-07-25 20:41:39 +00:00
|
|
|
flex-shrink: 0;
|
2021-05-03 13:48:46 +00:00
|
|
|
|
2022-06-21 09:19:14 +00:00
|
|
|
// If there are no languages and JavaScript is not enabled there is no fallback so we hide
|
|
|
|
// the button altogether.
|
|
|
|
.mw-portlet-lang-heading-0 {
|
|
|
|
.client-nojs & {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-04 02:23:19 +00:00
|
|
|
.vector-menu-heading {
|
2021-02-08 23:10:21 +00:00
|
|
|
// Prevent select of span text "X languages"
|
|
|
|
user-select: none;
|
2023-03-07 17:30:13 +00:00
|
|
|
// Set opacity to `1` on language button (it applies to more menu because of label color).
|
|
|
|
opacity: @opacity-base;
|
2021-07-16 15:32:42 +00:00
|
|
|
|
2021-11-30 19:38:26 +00:00
|
|
|
.vector-menu-heading-label {
|
2021-07-16 15:32:42 +00:00
|
|
|
// Special treatment for language button, based on Vector font-size
|
|
|
|
font-size: @font-size-base;
|
|
|
|
}
|
2021-02-01 23:13:58 +00:00
|
|
|
|
2021-12-01 19:49:12 +00:00
|
|
|
// T291286: Temporarily use progressive ULS style
|
|
|
|
&.mw-ui-progressive.mw-ui-quiet {
|
2023-03-28 20:22:36 +00:00
|
|
|
.mw-ui-icon::before {
|
2021-12-01 19:49:12 +00:00
|
|
|
// Ensure inverted language icon is white
|
2023-03-07 17:30:13 +00:00
|
|
|
opacity: @opacity-base;
|
2021-12-01 19:49:12 +00:00
|
|
|
}
|
|
|
|
|
2023-03-28 20:22:36 +00:00
|
|
|
&::after {
|
2021-12-01 19:49:12 +00:00
|
|
|
// Invert arrow color
|
|
|
|
background-image: url( ../common/images/arrow-down-progressive.svg );
|
2023-03-07 17:30:13 +00:00
|
|
|
opacity: @opacity-base;
|
2021-12-01 19:49:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
input:active + .vector-menu-heading {
|
|
|
|
&.mw-ui-progressive.mw-ui-quiet {
|
|
|
|
.mw-ui-icon {
|
2022-05-16 13:04:28 +00:00
|
|
|
// stylelint-disable-next-line plugin/no-unsupported-browser-features
|
2021-12-01 19:49:12 +00:00
|
|
|
filter: brightness( 0 ) invert( 1 );
|
|
|
|
}
|
|
|
|
|
2023-03-28 20:22:36 +00:00
|
|
|
&::after {
|
2021-12-01 19:49:12 +00:00
|
|
|
background-image: url( ../common/images/arrow-down-invert.svg );
|
|
|
|
}
|
|
|
|
}
|
2021-02-01 22:56:31 +00:00
|
|
|
}
|
|
|
|
|
2022-12-16 18:03:07 +00:00
|
|
|
// The `vector-menu-content` class is present twice in current implementation of language switcher
|
|
|
|
// (see FIXME in Dropdown/Open.mustache) so it is important we target the direct child.
|
|
|
|
> .vector-menu-content {
|
2021-02-01 22:56:31 +00:00
|
|
|
top: auto;
|
2021-07-16 15:32:42 +00:00
|
|
|
left: -@border-width-base;
|
2021-03-24 14:01:04 +00:00
|
|
|
right: -@border-width-base;
|
2021-02-01 23:13:58 +00:00
|
|
|
// align borders of open menu align with button
|
2022-05-12 20:17:03 +00:00
|
|
|
box-sizing: border-box;
|
2021-02-05 02:14:21 +00:00
|
|
|
max-height: 65vh;
|
2022-02-06 02:24:47 +00:00
|
|
|
overflow: auto;
|
2021-02-05 02:14:21 +00:00
|
|
|
|
2022-11-17 23:12:52 +00:00
|
|
|
// Adds to the show/hide technique in Dropdown.less with
|
2021-05-03 13:48:46 +00:00
|
|
|
// display to prevent rendering and long scrolling on Main page
|
|
|
|
display: none;
|
|
|
|
|
2021-02-05 02:14:21 +00:00
|
|
|
li a {
|
|
|
|
font-size: inherit;
|
|
|
|
}
|
2021-02-01 22:56:31 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 13:48:46 +00:00
|
|
|
.vector-menu-checkbox:checked ~ .vector-menu-content {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
2021-02-01 22:56:31 +00:00
|
|
|
.after-portlet {
|
2021-02-01 23:13:58 +00:00
|
|
|
// ensure there is a visual separation between the language links and additional links.
|
2021-02-05 02:14:21 +00:00
|
|
|
margin-top: 10px;
|
2021-02-01 22:56:31 +00:00
|
|
|
}
|
2022-12-19 15:57:48 +00:00
|
|
|
|
|
|
|
// styles for less prominent Language button (without label) to be used for non-content pages (see T316559)
|
|
|
|
.mw-portlet-lang-heading-empty + .vector-menu-content {
|
|
|
|
left: auto;
|
|
|
|
right: 0;
|
|
|
|
min-width: 300px;
|
|
|
|
|
|
|
|
.mw-portlet-empty-language-selector-body {
|
|
|
|
padding: 20px;
|
|
|
|
border-bottom: @border-style-base @border-width-base @border-color-portal-heading;
|
|
|
|
color: @color-base--subtle;
|
|
|
|
}
|
|
|
|
}
|
2021-02-01 22:56:31 +00:00
|
|
|
}
|
2021-02-04 02:23:19 +00:00
|
|
|
|
2021-07-26 21:00:38 +00:00
|
|
|
// Hides language button with CSS, ensures language button is in DOM for temporary JS hack for interwiki links
|
|
|
|
// Temporary solution to T287206, can be removed when ULS dialog includes interwiki links
|
|
|
|
#p-lang-btn.mw-portlet-empty {
|
|
|
|
display: none;
|
|
|
|
}
|
2022-11-17 23:12:52 +00:00
|
|
|
|
|
|
|
.mw-interlanguage-selector {
|
|
|
|
display: flex;
|
|
|
|
|
2023-03-28 20:22:36 +00:00
|
|
|
&::after {
|
2022-11-17 23:12:52 +00:00
|
|
|
.mixin-vector-menu-heading-arrow();
|
|
|
|
}
|
|
|
|
}
|
2023-01-31 19:21:41 +00:00
|
|
|
|
|
|
|
// Hide the "Add languages" on pages which are not action=view where there are 0 languages
|
|
|
|
.vector-dropdown > .vector-menu-heading.mw-portlet-lang-heading-0 {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Show it on view pages where there are 0 languages so user can add languages (JavaScript required)
|
|
|
|
.client-js .action-view .vector-dropdown > .vector-menu-heading.mw-portlet-lang-heading-0 {
|
|
|
|
display: flex;
|
|
|
|
}
|