| 1 |
// Note vector-feature-language-in-header-enabled class is not used here as that class |
| 2 |
// only applies to main page. |
| 3 |
// This must be limited to vector-page-titlebar as the mw-portlet-lang class is shared with |
| 4 |
// the language portlet that can display in the sidebar. |
| 5 |
.vector-page-titlebar .mw-portlet-lang { |
| 6 |
box-sizing: border-box; |
| 7 |
flex-shrink: 0; |
| 8 |
|
| 9 |
// If there are no languages and JavaScript is not enabled there is no fallback so we hide |
| 10 |
// the button altogether. |
| 11 |
.client-nojs & .mw-portlet-lang-heading-0 { |
| 12 |
display: none; |
| 13 |
} |
| 14 |
|
| 15 |
.vector-dropdown-label { |
| 16 |
// Prevent select of span text "X languages" |
| 17 |
user-select: none; |
| 18 |
// Set opacity to `1` on language button (it applies to more menu because of label color). |
| 19 |
opacity: @opacity-base; |
| 20 |
|
| 21 |
// T291286: Temporarily use progressive ULS style |
| 22 |
&.cdx-button--action-progressive.cdx-button--weight-quiet::after { |
| 23 |
mask-image: url( ./images/arrow-down-progressive.svg ); |
| 24 |
background-color: @color-progressive; |
| 25 |
opacity: @opacity-base; |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
.vector-dropdown-checkbox:active + .vector-dropdown-label { |
| 30 |
&.cdx-button--action-progressive.cdx-button--weight-quiet { |
| 31 |
.vector-icon { |
| 32 |
filter: brightness( 0 ) invert( 1 ); |
| 33 |
} |
| 34 |
|
| 35 |
&::after { |
| 36 |
// Invert arrow color |
| 37 |
background-image: url( ./images/arrow-down-invert.svg ); |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
.vector-dropdown-content { |
| 43 |
// align borders of open menu align with button |
| 44 |
box-sizing: border-box; |
| 45 |
max-height: 65vh; |
| 46 |
overflow: auto; |
| 47 |
.mixin-vector-dropdown-content-flip(); |
| 48 |
|
| 49 |
li a { |
| 50 |
font-size: inherit; |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
.after-portlet { |
| 55 |
// ensure there is a visual separation between the language links and additional links. |
| 56 |
margin-top: 10px; |
| 57 |
} |
| 58 |
|
| 59 |
.mw-portlet-lang-heading-empty { |
| 60 |
.mixin-vector-arrowed-dropdown-toggle(); |
| 61 |
} |
| 62 |
|
| 63 |
// styles for less prominent Language button (without label) to be used for non-content pages (see T316559) |
| 64 |
.mw-portlet-lang-heading-empty + .vector-dropdown-content { |
| 65 |
min-width: 300px; |
| 66 |
|
| 67 |
.mw-portlet-empty-language-selector-body { |
| 68 |
padding: 20px; |
| 69 |
border-bottom: @border-style-base @border-width-base @border-color-subtle; |
| 70 |
color: @color-subtle; |
| 71 |
} |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
// Hides language button with CSS, ensures language button is in DOM for temporary JS hack for interwiki links |
| 76 |
// Temporary solution to T287206, can be removed when ULS dialog includes interwiki links |
| 77 |
#p-lang-btn.mw-portlet-empty { |
| 78 |
display: none; |
| 79 |
} |
| 80 |
|
| 81 |
.mw-interlanguage-selector { |
| 82 |
.mixin-vector-arrowed-dropdown-toggle(); |
| 83 |
} |
| 84 |
|
| 85 |
// Hide the "Add languages" on pages which are not action=view where there are 0 languages |
| 86 |
.vector-dropdown > .mw-portlet-lang-heading-0 { |
| 87 |
display: none; |
| 88 |
} |
| 89 |
|
| 90 |
// IMPORTANT: Since dropdowns are visibility: hidden, it is important if ULS has been enabled |
| 91 |
// and taken over the menu, that we set the dropdown to display none to avoid impacting the |
| 92 |
// initial render. Language lists can be long (on some pages +200 links) so avoid having to |
| 93 |
// consider them in the render at all costs! In future, we may want to reconsider this component |
| 94 |
// and potentially use Minerva's fallback - where languages are inside the footer, but that's |
| 95 |
// a change for another day! |
| 96 |
.client-js .mw-portlet-lang .vector-dropdown-content { |
| 97 |
display: none; |
| 98 |
|
| 99 |
// ... since ULS is an optional dependency it may not be installed. |
| 100 |
.vector-uls-disabled& { |
| 101 |
display: inherit; |
| 102 |
} |
| 103 |
} |
| 104 |
|
| 105 |
// Show it on view pages where there are 0 languages so user can add languages (JavaScript required) |
| 106 |
.client-js .action-view .vector-dropdown { |
| 107 |
> .mw-portlet-lang-heading-0 { |
| 108 |
display: flex; |
| 109 |
} |
| 110 |
|
| 111 |
.mw-interlanguage-selector-empty:checked ~ .vector-dropdown-content { |
| 112 |
display: inherit; |
| 113 |
} |
| 114 |
} |