Skip to content

Commit

Permalink
fix(theme-default): fix header anchor offset regression
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed May 26, 2022
1 parent 2fe5b72 commit e4b4ded
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions packages/@vuepress/theme-default/src/client/styles/layout.scss
Expand Up @@ -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 {
Expand All @@ -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;
Expand All @@ -141,7 +143,7 @@ h6 {
}
}

.theme-default-content:not(.custom) {
.theme-default-content {
@include content_wrapper;

padding-top: 0;
Expand All @@ -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 {
Expand Down

0 comments on commit e4b4ded

Please sign in to comment.