From ec6b6ebd9aa11e3fa7aa3375ad502100ccb233db Mon Sep 17 00:00:00 2001 From: Jon Robson Date: Thu, 23 Jun 2022 16:32:00 -0700 Subject: [PATCH] Revise margin collapsing rules with new layout Follow up to 97783e5 Bug: T311283 Change-Id: Ia0581713fd182b9236e398a2453efd06ce8b9f1f --- resources/skins.vector.styles/layouts/screen.less | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/resources/skins.vector.styles/layouts/screen.less b/resources/skins.vector.styles/layouts/screen.less index 643e0b87e..975e728c4 100644 --- a/resources/skins.vector.styles/layouts/screen.less +++ b/resources/skins.vector.styles/layouts/screen.less @@ -95,7 +95,12 @@ body { } .mw-body-subheader { + // avoid margin collapsing by setting a height and margin-top as this will sometimes + // be empty if no indicators. + // The total of margin-top and height should be 16px. Since we're using relative units 1em=14px + // We need to set both height and margin so that the margin is not ignored. margin-top: 1em; + height: 2px; } .mw-header { @@ -130,14 +135,6 @@ body { z-index: @z-index-base; } -// Prevents margin collapsing on first element (typically a

) of content. -// Custom because .mixin-clearfix() automatically appends :after to the selector -// and doesn't prevent margin collapsing. -.vector-body:before { - content: ''; - display: table; -} - /* Navigation Containers */ .vector-layout-legacy .mw-article-toolbar-container { // Clear the floats on #left-navigation and #right-navigation.