| 1 |
/** |
| 2 |
* Less mixins. |
| 3 |
*/ |
| 4 |
@import 'mediawiki.skin.variables.less'; |
| 5 |
@import 'mediawiki.mixins.less'; |
| 6 |
|
| 7 |
.mixin-vector-page-container-sizing() { |
| 8 |
// Set a min-width to make explicit we do not support anything below this threshold. |
| 9 |
// For devices too small, they should be more useable with horizontal scrolling. |
| 10 |
// e.g. Portrait on an iPad |
| 11 |
min-width: @min-width-supported; |
| 12 |
max-width: @max-width-page-container; |
| 13 |
padding-left: @padding-horizontal-page-container; |
| 14 |
padding-right: @padding-horizontal-page-container; |
| 15 |
box-sizing: border-box; |
| 16 |
} |
| 17 |
|
| 18 |
.mixin-vector-arrowed-dropdown-toggle() { |
| 19 |
display: inline-flex; |
| 20 |
align-items: center; |
| 21 |
|
| 22 |
&::after { |
| 23 |
content: ''; |
| 24 |
.cdx-mixin-css-icon( @cdx-icon-expand, @param-size-icon: @size-icon-x-small ); |
| 25 |
width: unit( 12 / @font-size-browser, rem ); |
| 26 |
height: unit( 12 / @font-size-browser, rem ); |
| 27 |
// https://phabricator.wikimedia.org/T319070#8284272 |
| 28 |
margin-left: 7px; |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
.mixin-vector-content-box() { |
| 33 |
background-color: @background-color-base; |
| 34 |
} |
| 35 |
|
| 36 |
.mixin-vector-dropdown-menu() { |
| 37 |
.mixin-vector-content-box(); |
| 38 |
padding: @padding-horizontal-dropdown-menu @padding-vertical-dropdown-menu; |
| 39 |
font-size: @font-size-dropdown; |
| 40 |
box-shadow: 0 2px 6px -1px rgba( 0, 0, 0, 0.2 ); |
| 41 |
transition-property: opacity; |
| 42 |
transition-duration: @transition-duration-base; |
| 43 |
// TODO Add consistent min/max values for dropdowns in T316055 |
| 44 |
width: max-content; |
| 45 |
max-width: 200px; |
| 46 |
} |
| 47 |
|
| 48 |
// Base links without a visited state |
| 49 |
.mixin-vector-unvisited-link-base() { |
| 50 |
&:visited { |
| 51 |
color: @color-progressive; |
| 52 |
} |
| 53 |
|
| 54 |
&:visited:hover { |
| 55 |
color: @color-progressive--hover; |
| 56 |
} |
| 57 |
} |
| 58 |
|
| 59 |
// Red links without a visited state |
| 60 |
.mixin-vector-unvisited-link-red() { |
| 61 |
&:visited { |
| 62 |
color: @color-link-red; |
| 63 |
} |
| 64 |
|
| 65 |
&:visited:hover { |
| 66 |
color: @color-link-red--hover; |
| 67 |
} |
| 68 |
} |
| 69 |
|
| 70 |
// Used for "selected" links inside tabs and dropdowns |
| 71 |
.mixin-vector-selected-link() { |
| 72 |
// Override all link states to style it as text |
| 73 |
color: @color-base !important; /* stylelint-disable-line declaration-no-important */ |
| 74 |
} |
| 75 |
|
| 76 |
.mixin-vector-dropdown-menu-item() { |
| 77 |
display: flex; |
| 78 |
align-items: center; |
| 79 |
padding: @padding-vertical-dropdown-menu-item 0; |
| 80 |
|
| 81 |
.vector-icon { |
| 82 |
margin-right: @spacing-35; |
| 83 |
} |
| 84 |
|
| 85 |
&:not( .mw-selflink ) { |
| 86 |
.mixin-vector-unvisited-link-base(); |
| 87 |
} |
| 88 |
|
| 89 |
&.selected a { |
| 90 |
.mixin-vector-selected-link(); |
| 91 |
} |
| 92 |
} |
| 93 |
|
| 94 |
.mixin-vector-scrollable-with-fade() { |
| 95 |
overflow: hidden auto; |
| 96 |
|
| 97 |
&::after { |
| 98 |
content: ''; |
| 99 |
display: block; |
| 100 |
position: sticky; |
| 101 |
bottom: 0; |
| 102 |
left: 0; |
| 103 |
right: 0; |
| 104 |
height: @padding-vertical-dropdown-menu; |
| 105 |
background: linear-gradient( rgba( 255, 255, 255, 0 ), @background-color-page-container ); |
| 106 |
background-repeat: no-repeat; |
| 107 |
pointer-events: none; // Make the link below the fade clickable |
| 108 |
} |
| 109 |
} |
| 110 |
|
| 111 |
.mixin-vector-dropdown-content-flip() { |
| 112 |
left: auto; |
| 113 |
right: 0; |
| 114 |
} |