2021-08-30 22:44:00 +00:00
|
|
|
@import '../../common/variables.less';
|
|
|
|
@import 'mediawiki.mixins.less';
|
|
|
|
|
|
|
|
.vector-sticky-header {
|
|
|
|
width: 100%;
|
2021-09-28 22:43:15 +00:00
|
|
|
height: @height-sticky-header;
|
2021-08-30 22:44:00 +00:00
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
z-index: @z-index-header;
|
|
|
|
transform: translateY( -100% );
|
2021-12-07 19:41:46 +00:00
|
|
|
transition: @transition-sticky-header;
|
2021-08-30 22:44:00 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0 auto;
|
|
|
|
background: @background-color-base;
|
|
|
|
background-color: #fffffff7;
|
|
|
|
border-bottom: 1px solid @colorGray14;
|
|
|
|
// FIXME: Should this adapt to different thresholds? Ask Alex!
|
|
|
|
padding: 6px 8px 6px 10px;
|
|
|
|
justify-content: space-between;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
@media ( min-width: @width-breakpoint-desktop ) {
|
|
|
|
padding: 6px 25px;
|
2022-04-28 18:21:52 +00:00
|
|
|
max-width: @max-width-page-container + ( @padding-horizontal-page-container * 2 );
|
|
|
|
}
|
|
|
|
|
|
|
|
@media ( min-width: @width-breakpoint-desktop-wide ) {
|
|
|
|
padding: 6px 25px;
|
|
|
|
max-width: @max-width-page-container + ( @padding-horizontal-page-container-wide * 2 );
|
2021-08-30 22:44:00 +00:00
|
|
|
}
|
|
|
|
|
2022-02-03 20:54:16 +00:00
|
|
|
// T298836 Hide the sticky header at lower resolutions.
|
|
|
|
@media ( max-width: @width-breakpoint-desktop ) {
|
2021-09-03 15:55:50 +00:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2021-09-16 19:27:10 +00:00
|
|
|
// Hide any open menus/search results unless sticky header is visible
|
|
|
|
&:not( .vector-sticky-header-visible ) > div {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2021-08-30 22:44:00 +00:00
|
|
|
&-visible {
|
|
|
|
transform: translateY( 0% );
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Layout
|
|
|
|
//
|
2021-09-24 21:00:32 +00:00
|
|
|
&-start,
|
|
|
|
&-end,
|
|
|
|
&-icons,
|
|
|
|
&-context-bar {
|
2021-08-30 22:44:00 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
2021-09-24 21:00:32 +00:00
|
|
|
&-start {
|
2022-02-14 19:06:33 +00:00
|
|
|
flex-grow: 1;
|
2022-02-03 20:29:41 +00:00
|
|
|
min-width: 0;
|
2021-08-30 22:44:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Components
|
|
|
|
//
|
|
|
|
&-context-bar {
|
2021-09-24 21:00:32 +00:00
|
|
|
border-left: 1px solid #c8c8c8;
|
2021-08-30 22:44:00 +00:00
|
|
|
margin: 0 15px;
|
|
|
|
padding-left: 30px;
|
2021-09-24 21:00:32 +00:00
|
|
|
white-space: nowrap;
|
2022-02-03 20:29:41 +00:00
|
|
|
min-width: 0;
|
2021-08-30 22:44:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&-context-bar-primary {
|
2021-09-14 21:10:46 +00:00
|
|
|
overflow: hidden;
|
2021-11-24 20:59:16 +00:00
|
|
|
font-family: @font-family-serif;
|
|
|
|
// T296320 closest standardized option to 22px (24px)
|
|
|
|
font-size: @font-size-heading-2;
|
2022-02-03 20:29:41 +00:00
|
|
|
text-overflow: ellipsis;
|
2022-02-19 00:14:15 +00:00
|
|
|
|
|
|
|
// T300134 Prevent text from wrapping in the sticky header.
|
|
|
|
wbr {
|
|
|
|
display: none;
|
|
|
|
}
|
2021-08-30 22:44:00 +00:00
|
|
|
}
|
2021-09-09 21:40:06 +00:00
|
|
|
|
|
|
|
.vector-search-box {
|
|
|
|
// Hide the search box until the user toggles it.
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.vector-header-search-toggled {
|
2021-12-16 03:13:56 +00:00
|
|
|
// .wvui-input__input left padding (36px) - the .wvui-icon svg width (20px)
|
|
|
|
// - the icon left padding (12px [1]) = 4px
|
|
|
|
// [1] see .wvui-typeahead-search--show-thumbnail .wvui-input__input:focus)
|
|
|
|
@margin-start-search-box: 4px;
|
|
|
|
|
2021-09-09 21:40:06 +00:00
|
|
|
.vector-sticky-header-search-toggle,
|
|
|
|
.vector-sticky-header-context-bar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-search-box {
|
|
|
|
display: block;
|
|
|
|
flex-basis: unit( 500px / @font-size-browser / @font-size-base, em );
|
2021-12-16 03:13:56 +00:00
|
|
|
margin-left: @margin-start-search-box;
|
2021-09-09 21:40:06 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 03:13:56 +00:00
|
|
|
// T296318 Decrease the start margin of the search box to account for the
|
|
|
|
// icon's increased start position when the search component has thumbnails.
|
2021-09-09 21:40:06 +00:00
|
|
|
.vector-search-box-show-thumbnail {
|
2021-12-16 03:13:56 +00:00
|
|
|
margin-left: @margin-start-search-box - ( @size-search-expand / 2 );
|
2021-11-24 21:16:31 +00:00
|
|
|
|
|
|
|
.wvui-input__start-icon {
|
|
|
|
color: @colorGray2;
|
|
|
|
}
|
2021-09-09 21:40:06 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-30 22:44:00 +00:00
|
|
|
}
|
2021-09-03 15:55:50 +00:00
|
|
|
|
|
|
|
.client-nojs .vector-sticky-header {
|
|
|
|
display: none;
|
|
|
|
}
|
2021-09-28 22:43:15 +00:00
|
|
|
|
|
|
|
@media ( min-width: @width-breakpoint-tablet ) {
|
|
|
|
.client-js.vector-sticky-header-enabled {
|
2021-09-20 23:37:54 +00:00
|
|
|
// T290518: When the sticky header is enabled (feature flag is on, js is
|
|
|
|
// enabled, and viewport is at higher resolutions), add scroll padding to the
|
|
|
|
// root element. This is needed so that the sticky header does not overlap the
|
|
|
|
// top of an element when the URI has a hash fragment (e.g. when the user clicks
|
|
|
|
// a jump link) and when the user tabs through elements in reverse order.
|
|
|
|
//
|
|
|
|
// Please note that this class must be independent of the
|
|
|
|
// .vector-sticky-header-visible class to correctly handle situations where the
|
|
|
|
// sticky header isn't visible yet but we still need scroll padding applied
|
|
|
|
// (e.g. when the user navigates to a page with a hash fragment in the URI).
|
2021-09-28 22:43:15 +00:00
|
|
|
scroll-padding-top: @height-sticky-header;
|
2021-09-20 23:37:54 +00:00
|
|
|
|
|
|
|
// T289817 Override other sticky element offsets to ensure that other
|
|
|
|
// sticky elements (i.e. table headers) appear below the sticky header.
|
2021-09-24 21:00:32 +00:00
|
|
|
.mw-sticky-header-element,
|
|
|
|
.charts-stickyhead th {
|
2021-09-20 23:37:54 +00:00
|
|
|
/* stylelint-disable-next-line declaration-no-important */
|
|
|
|
top: @height-sticky-header !important;
|
|
|
|
}
|
2021-09-28 22:43:15 +00:00
|
|
|
}
|
|
|
|
}
|