diff --git a/includes/templates/index.mustache b/includes/templates/index.mustache
index 1b21482c9..5b1494139 100644
--- a/includes/templates/index.mustache
+++ b/includes/templates/index.mustache
@@ -35,8 +35,9 @@
}}
{{{html-headelement}}}
-
{{#html-sitenotice}}
@@ -67,6 +68,10 @@
{{{html-dataAfterContent}}}
+
+
+
{{{html-navigation-heading}}}
diff --git a/resources/skins.vector.styles/index.less b/resources/skins.vector.styles/index.less
index 45589f818..8698e50c2 100644
--- a/resources/skins.vector.styles/index.less
+++ b/resources/skins.vector.styles/index.less
@@ -1,9 +1,10 @@
@import '../../variables.less';
+@import 'mediawiki.mixins.less';
/* Vector screen styles */
@media screen {
@import 'common.less';
- @import 'legacy/layout.less';
+ @import 'layout.less';
@import 'PersonalMenu.less';
@import 'SearchBox.less';
@import 'VectorTabs.less';
diff --git a/resources/skins.vector.styles/layout.less b/resources/skins.vector.styles/layout.less
new file mode 100644
index 000000000..109f2f5d8
--- /dev/null
+++ b/resources/skins.vector.styles/layout.less
@@ -0,0 +1,108 @@
+// Layout rules divide the page into sections and how VectorComponents should be arranged in the skin.
+// The rules here should only define the layout, not color or typography.
+
+@import '../../variables.less';
+@import 'mediawiki.mixins.less';
+
+// Modern layout variables
+@height-tabs: 2.5em; // Keep in sync with .vectorTabs height
+
+// Header sizes defined in the description of T246170 and comment T246170#5957100
+@padding-horizontal-header: 24px;
+@padding-top-header: 10px;
+@padding-bottom-header: 5px;
+@height-header--inner: 54px;
+@height-logo-icon: 50px; // Logo sizes per specification in T245190.
+@height-header: @height-header--inner +
+ @padding-top-header + @padding-bottom-header; // 54px + 10px + 5px = 69px;
+@width-grid-column-one: 11em;
+
+/* Space for header above content */
+.mw-header-placeholder {
+ // Reserve space for the absolute positioned header and tabs.
+ height: @height-header; // Pixels.
+ padding-bottom: @height-tabs; // Different unit: em.
+}
+
+/* Header layout */
+.mw-header {
+ position: absolute;
+ z-index: @z-index-header;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: @height-header--inner;
+
+ // Padding is outside the sizing box (content-box).
+ padding: @padding-top-header @padding-horizontal-header @padding-bottom-header;
+
+ // Vertical centering of header elements (IE>=11), requires flex.
+ // Non-flex fallback for IE<=9: float rule on the child elements.
+ .flex-display();
+ // https://caniuse.com/#search=align-items
+ align-items: center;
+}
+
+/* Main column */
+.mw-body,
+#mw-data-after-content,
+#left-navigation,
+#footer, /* FIXME: Remove 2 weeks after deployment. */
+.mw-footer {
+ margin-left: @width-grid-column-one;
+}
+
+/* Content */
+.mw-indicators {
+ float: right;
+ z-index: @z-index-indicators;
+}
+
+.mw-body-content {
+ position: relative;
+ z-index: @z-index-base;
+}
+
+/* Hide, but keep accessible for screen-readers */
+#mw-navigation h2 {
+ position: absolute;
+ top: -9999px;
+}
+
+/* Tabs */
+#mw-head {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 100%;
+}
+
+/* Navigation Containers */
+#left-navigation {
+ float: left;
+ margin-top: @height-header;
+ /* When right nav would overlap left nav, it's placed below it
+ (normal CSS floats behavior). This rule ensures that no empty space
+ is shown between them due to right nav's margin-top. Page layout
+ is still broken, but at least the nav overlaps only the page title
+ instead of half the content. */
+ margin-bottom: -@height-header;
+}
+
+#right-navigation {
+ float: right;
+ margin-top: @height-header;
+}
+
+#mw-panel {
+ position: absolute;
+ z-index: @z-index-sidebar;
+ top: 0;
+ width: @width-grid-column-one;
+ left: 0;
+}
+
+#footer, /* FIXME: Remove 2 weeks after deployment. */
+.mw-footer {
+ margin-top: 0;
+}
diff --git a/variables.less b/variables.less
index 076130e58..f5c4ac57a 100644
--- a/variables.less
+++ b/variables.less
@@ -115,6 +115,8 @@
// See skinStyles/jquery.ui/jquery.ui.datepicker.css.
// @z-index-ui-datepicker-cover: -1;
@z-index-base: 0;
+@z-index-header: 1;
+@z-index-sidebar: 1;
@z-index-menu-checkbox: 1;
@z-index-search-button: 1;
// Ensure that this is displayed on top of .mw-body-content and clickable.