mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-25 08:05:51 +00:00
6c817e932f
- Register new feature for main menu pinned - Update UserPreferenceRequirement to optionally handle default config values - Add nav landmarks for the main menu Bug: T317900 Change-Id: I8fc6e0a79a1155d68afb9e33e5101a2a160dc4e5
144 lines
4.1 KiB
Plaintext
144 lines
4.1 KiB
Plaintext
//
|
|
// Grid layout
|
|
//
|
|
|
|
// Match styles between TOC and fade element to ensure the fade covers the correct area
|
|
// This is expressed in pixels to support different font sizes since our layout is currently
|
|
// expressed in pixels. See T313817.
|
|
#vector-toc-pinned-container .sidebar-toc:after,
|
|
#vector-toc-pinned-container .sidebar-toc,
|
|
.vector-feature-page-tools-disabled .vector-main-menu,
|
|
.vector-main-menu-container .vector-main-menu {
|
|
// T305069 Layout adjustments of sidebar elements
|
|
// Align the left edge of main menu with the main menu button.
|
|
width: @width-sidebar-px;
|
|
|
|
// Align the left edge of main menu with the main menu button icon.
|
|
@media ( min-width: @min-width-desktop-wide ) {
|
|
width: @width-sidebar-px-wide;
|
|
}
|
|
}
|
|
|
|
@media ( min-width: @min-width-desktop ) {
|
|
.mw-page-container-inner {
|
|
display: grid;
|
|
width: 100%;
|
|
column-gap: 8px; // 8px + 12px (.mw-body padding-left) = 20px total spacing
|
|
grid-template: ~'min-content min-content min-content 1fr min-content / 232px minmax(0, 1fr)';
|
|
grid-template-areas: 'header header'
|
|
'siteNotice siteNotice'
|
|
'mainMenu pageContent'
|
|
'toc pageContent'
|
|
'footer footer';
|
|
}
|
|
|
|
.vector-sitenotice-container {
|
|
grid-area: siteNotice;
|
|
}
|
|
|
|
.mw-table-of-contents-container {
|
|
grid-area: toc;
|
|
}
|
|
|
|
.mw-header {
|
|
grid-area: header;
|
|
}
|
|
|
|
.vector-main-menu-container {
|
|
grid-area: mainMenu;
|
|
}
|
|
|
|
.mw-content-container {
|
|
grid-area: pageContent;
|
|
}
|
|
|
|
.mw-footer-container {
|
|
grid-area: footer;
|
|
}
|
|
}
|
|
|
|
@media ( min-width: @min-width-desktop-wide ) {
|
|
.mw-page-container-inner {
|
|
/* Use of minmax is important to restrict the maximum grid column width
|
|
more information: T314756 */
|
|
grid-template-columns: ~'284px minmax(0, 1fr)';
|
|
}
|
|
}
|
|
|
|
.mw-content-container,
|
|
.mw-table-of-contents-container {
|
|
.vector-feature-page-tools-disabled & {
|
|
max-width: @max-width-content-container;
|
|
}
|
|
|
|
.vector-feature-limited-width-disabled &,
|
|
.vector-feature-limited-width-content-disabled & {
|
|
// Allow the max-width of content on history/special pages to be wider than
|
|
// the max-width of content on article pages.
|
|
// Note, we don't disable the max-width on .vector-page-toolbar-container intentionally
|
|
// to support easier navigation between tabs.
|
|
// See T293441 for further information on that.
|
|
// Both rules are !important as they are final. Max-width on a page should be restored by removing the `skin-vector-disable-max-width`,
|
|
// preferably by modification to the feature flag VectorMaxWidthOptions. Code should never attempt to override this rule.
|
|
/* stylelint-disable-next-line declaration-no-important */
|
|
max-width: none !important;
|
|
/* stylelint-disable-next-line declaration-no-important */
|
|
width: 100% !important;
|
|
}
|
|
}
|
|
|
|
// Horizontally center content when column start is empty (i.e. no pinned ToC or pinned main menu)
|
|
.vector-feature-page-tools-disabled {
|
|
@{selector-sidebar-no-toc-sidebar-closed},
|
|
&.vector-toc-unpinned @{selector-main-menu-closed} {
|
|
& ~ .mw-content-container {
|
|
grid-column: mainMenu / pageContent;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
width: 100%;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Horizontally center content when column start is empty (i.e. no pinned ToC or pinned main menu)
|
|
.vector-feature-page-tools-enabled {
|
|
&.vector-feature-main-menu-pinned-disabled .vector-sidebar-container-no-toc ~ .mw-content-container,
|
|
&.vector-toc-unpinned.vector-feature-main-menu-pinned-disabled .mw-content-container {
|
|
grid-column: mainMenu / pageContent;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
}
|
|
|
|
@media ( min-width: @min-width-desktop ) {
|
|
.vector-feature-page-tools-enabled .mw-body {
|
|
display: grid;
|
|
grid-auto-rows: auto;
|
|
grid-template-columns: ~'minmax(0, @{max-width-content-container}) min-content';
|
|
grid-template-areas: 'titlebar .'
|
|
'toolbar columnEnd'
|
|
'content columnEnd';
|
|
|
|
.vector-feature-limited-width-disabled&,
|
|
.vector-feature-limited-width-content-disabled& {
|
|
grid-template-columns: ~'1fr min-content';
|
|
}
|
|
|
|
.vector-page-titlebar {
|
|
grid-area: titlebar;
|
|
}
|
|
|
|
.vector-page-toolbar {
|
|
grid-area: toolbar;
|
|
}
|
|
|
|
#bodyContent {
|
|
grid-area: content;
|
|
}
|
|
|
|
.vector-column-end {
|
|
grid-area: columnEnd;
|
|
}
|
|
}
|
|
}
|