From b0adba847bfc2ef11ec9c60c26fb607755e6554d Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 2 Apr 2026 15:57:31 +0200 Subject: [PATCH 1/5] Layout: Adapt to static elastic-nav by making secondary nav sticky The global elastic-nav.js (v2026-03) changed the header from fixed to static positioning. This makes the secondary docs nav sticky at the top and simplifies --offset-top to match its height. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Assets/assembler.css | 28 ++----------------- .../Layout/_SecondaryNav.cshtml | 2 +- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/Elastic.Documentation.Site/Assets/assembler.css b/src/Elastic.Documentation.Site/Assets/assembler.css index 39ba8e8ea5..afe96479f0 100644 --- a/src/Elastic.Documentation.Site/Assets/assembler.css +++ b/src/Elastic.Documentation.Site/Assets/assembler.css @@ -1,31 +1,9 @@ /* Assembler build type specific styles */ +/* Elastic global nav is position:static (scrolls with page). + Only the secondary nav (Docs sub-header) is sticky, so offset-top matches its height. */ :root { - /* Assembler uses Elastic global nav with banner - different heights at different breakpoints */ - --offset-top: calc(64px + 38px); /* header height + banner height */ -} - -@media screen and (min-width: 767px) { - :root { - --offset-top: calc(72px + 38px); /* header height + banner height */ - } -} - -@media screen and (min-width: 992px) { - :root { - --offset-top: 110px; - } -} - -@media screen and (min-width: 1180px) { - :root { - --offset-top: calc(80px + 38px); /* header height + banner height */ - } -} - -/* Elastic nav wrapper and nav styles - assembler specific */ -#elastic-nav-wrapper { - min-height: var(--offset-top); + --offset-top: calc(var(--spacing) * 18); } /* Air-gapped: uses elastic-docs-header web component instead of elastic nav */ diff --git a/src/Elastic.Documentation.Site/Layout/_SecondaryNav.cshtml b/src/Elastic.Documentation.Site/Layout/_SecondaryNav.cshtml index 0a4d2ef3ca..c6e5d27ea5 100644 --- a/src/Elastic.Documentation.Site/Layout/_SecondaryNav.cshtml +++ b/src/Elastic.Documentation.Site/Layout/_SecondaryNav.cshtml @@ -1,5 +1,5 @@ @inherits RazorSlice -
+