From e4b4dedea8652b305d9092a7d236479ffcef6741 Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Thu, 26 May 2022 11:52:47 +0800 Subject: [PATCH] fix(theme-default): fix header anchor offset regression --- .../src/client/styles/layout.scss | 43 ++++++++----------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/packages/@vuepress/theme-default/src/client/styles/layout.scss b/packages/@vuepress/theme-default/src/client/styles/layout.scss index 94cd01eb87..a84c9f8f98 100644 --- a/packages/@vuepress/theme-default/src/client/styles/layout.scss +++ b/packages/@vuepress/theme-default/src/client/styles/layout.scss @@ -86,14 +86,16 @@ } &.no-navbar { - .theme-default-content:not(.custom) > h1, - h2, - h3, - h4, - h5, - h6 { - margin-top: 1.5rem; - padding-top: 0; + .theme-default-content { + h1, + h2, + h3, + h4, + h5, + h6 { + margin-top: 1.5rem; + padding-top: 0; + } } .page { @@ -118,13 +120,13 @@ } } -h1, -h2, -h3, -h4, -h5, -h6 { - .theme-default-content:not(.custom) > & { +.theme-default-content { + h1, + h2, + h3, + h4, + h5, + h6 { margin-top: calc(0.5rem - var(--navbar-height)); padding-top: calc(1rem + var(--navbar-height)); margin-bottom: 0; @@ -141,7 +143,7 @@ h6 { } } -.theme-default-content:not(.custom) { +.theme-default-content { @include content_wrapper; padding-top: 0; @@ -155,15 +157,6 @@ h6 { } } -.theme-default-content.custom { - padding: 0; - margin: 0; - - img { - max-width: 100%; - } -} - // narrow desktop / iPad @media (max-width: $MQNarrow) { .sidebar {