| 1 |
/** |
| 2 |
* PinnableElement |
| 3 |
* Pinned containers are typically dropdown menus that have been |
| 4 |
* placed in a sidebar column, e.g. page tools menu, main menu. |
| 5 |
*/ |
| 6 |
|
| 7 |
.vector-pinnable-element { |
| 8 |
font-size: @font-size-dropdown; |
| 9 |
} |
| 10 |
|
| 11 |
.vector-pinned-container { |
| 12 |
.mixin-vector-content-box(); |
| 13 |
padding: 0 @padding-horizontal-dropdown-menu; |
| 14 |
margin-bottom: 2rem; |
| 15 |
display: none; |
| 16 |
|
| 17 |
// If there is no display grid support we remove pinnable elements |
| 18 |
@supports ( display: grid ) { |
| 19 |
display: block; |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
.vector-column-start, |
| 24 |
.vector-column-end { |
| 25 |
// Support: Chrome |
| 26 |
// Work around sticky-positioned layers disabling subpixel text rendering (T327460, T373066). |
| 27 |
// This must be applied to the possible parent elements of .vector-sticky-pinned-container. |
| 28 |
contain: paint; |
| 29 |
} |
| 30 |
|
| 31 |
.vector-sticky-pinned-container { |
| 32 |
.mixin-vector-scrollable-with-fade(); |
| 33 |
// Applies styles for making a pinned element sticky |
| 34 |
position: sticky; |
| 35 |
top: @grid-row-gap; |
| 36 |
// Border-box changes the height calculation. |
| 37 |
box-sizing: border-box; |
| 38 |
// Height is viewport height - row gap above and below the container. |
| 39 |
max-height: ~'calc( 100vh - (@{grid-row-gap} * 2) )'; |
| 40 |
} |
| 41 |
|
| 42 |
@media ( max-width: @max-width-breakpoint-tablet ) { |
| 43 |
/** |
| 44 |
* At lower resolutions, we want to hide the pinned containers when JS is enabled since these |
| 45 |
* elements collapse (become unpinned) at this resolution via PinnableElement.js. |
| 46 |
* Although this is handled in JS, this rule prevents the pinned menu from |
| 47 |
* appearing on pageload, at low resolutions, before the JS kicks in. |
| 48 |
*/ |
| 49 |
.client-js .vector-pinned-container { |
| 50 |
display: none; |
| 51 |
} |
| 52 |
|
| 53 |
/** |
| 54 |
* T357022 Sticky pinned containers have an ::after psuedo-element used to indicate the |
| 55 |
* container is scrollable. On lower resolutions sticky pinned containers will always |
| 56 |
* be empty. We need to set the container to display: none to prevent the psuedo-element |
| 57 |
* height from affecting the layout |
| 58 |
*/ |
| 59 |
.client-js .vector-sticky-pinned-container { |
| 60 |
display: none; |
| 61 |
} |
| 62 |
} |