diff --git a/client/src/app.scss b/client/src/app.scss
index 619b971270cf..72f1a36aff69 100644
--- a/client/src/app.scss
+++ b/client/src/app.scss
@@ -102,8 +102,10 @@
--top-nav-height: 4rem;
--article-actions-container-height: 2rem;
--icon-size: 1rem;
- --sticky-header-height: calc(
- var(--top-nav-height) + var(--article-actions-container-height) + 2px
+ --sticky-header-without-actions-height: calc(var(--top-nav-height) + 1px);
+ --sticky-header-with-actions-height: calc(
+ var(--sticky-header-without-actions-height) +
+ var(--article-actions-container-height) + 1px
);
}
@@ -121,7 +123,11 @@
}
:target {
- scroll-margin-top: var(--sticky-header-height);
+ scroll-margin-top: var(--sticky-header-with-actions-height);
+}
+
+.sticky-header-container.without-actions ~ * :target {
+ scroll-margin-top: var(--sticky-header-without-actions-height);
}
body {
@@ -340,3 +346,9 @@ sup.new {
background: var(--new-background-beta, var(--new-background));
}
}
+
+.sticky-header-container {
+ position: sticky;
+ top: 0;
+ z-index: var(--z-index-main-header);
+}
diff --git a/client/src/app.tsx b/client/src/app.tsx
index 656656cca46f..243208bed85e 100644
--- a/client/src/app.tsx
+++ b/client/src/app.tsx
@@ -55,7 +55,9 @@ function Layout({ pageType, children }) {
>