From e99df98e56437f0629425dc86535690cfab5b763 Mon Sep 17 00:00:00 2001 From: world970511 Date: Sun, 9 Aug 2026 19:54:05 +0900 Subject: [PATCH 1/2] [ZEPPELIN-6629] Fix anchor links hidden under navbar --- docs/assets/themes/zeppelin/css/style.css | 4 ++++ docs/assets/themes/zeppelin/js/docs.js | 16 ---------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/docs/assets/themes/zeppelin/css/style.css b/docs/assets/themes/zeppelin/css/style.css index b07bc25ec45..e0379c8a9f6 100644 --- a/docs/assets/themes/zeppelin/css/style.css +++ b/docs/assets/themes/zeppelin/css/style.css @@ -11,6 +11,10 @@ body { font-size: 15px; } +html { + scroll-padding-top: 60px; +} + .jumbotron { background-color: #3071a9; } diff --git a/docs/assets/themes/zeppelin/js/docs.js b/docs/assets/themes/zeppelin/js/docs.js index 33863a367c7..faf57e413ba 100644 --- a/docs/assets/themes/zeppelin/js/docs.js +++ b/docs/assets/themes/zeppelin/js/docs.js @@ -96,15 +96,6 @@ function viewSolution() { }); } -// A script to fix internal hash links because we have an overlapping top bar. -// Based on https://github.com/twitter/bootstrap/issues/193#issuecomment-2281510 -function maybeScrollToHash() { - if (window.location.hash && $(window.location.hash).length) { - var newTop = $(window.location.hash).offset().top - 57; - $(window).scrollTop(newTop); - } -} - $(function() { codeTabs(); // Display anchor links when hovering over headers. For documentation of the @@ -114,10 +105,6 @@ $(function() { }; anchors.add(); - $(window).bind('hashchange', function() { - maybeScrollToHash(); - }); - $(document).ready(function() { $('#toc').toc(); }); @@ -131,7 +118,4 @@ $(function() { } }); - // Scroll now too in case we had opened the page on a hash, but wait a bit because some browsers - // will try to do *their* initial scroll after running the onReady handler. - $(window).load(function() { setTimeout(function() { maybeScrollToHash(); }, 25); }); }); From e94100107e4e04ec44d059393e6bb3a0b1cc280a Mon Sep 17 00:00:00 2001 From: world970511 Date: Mon, 5 Oct 2026 20:48:40 +0900 Subject: [PATCH 2/2] [ZEPPELIN-6629] Tie navbar height values to a single CSS variable Address review feedback on #5407: scroll-padding-top and the navbar's height both hardcoded the same 60px value, which is exactly what let them drift apart and caused the anchor-link bug in the first place. Introduce --navbar-height and have both declarations, plus the collapse panel's max-height which derives from the same value, read from it instead. --- docs/assets/themes/zeppelin/css/style.css | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/assets/themes/zeppelin/css/style.css b/docs/assets/themes/zeppelin/css/style.css index e0379c8a9f6..408223500f6 100644 --- a/docs/assets/themes/zeppelin/css/style.css +++ b/docs/assets/themes/zeppelin/css/style.css @@ -2,6 +2,10 @@ @import url('../font/fonts-patua-one.css'); @import url('../font/fonts-open-sans.css'); +:root { + --navbar-height: 60px; +} + body { padding-top: 50px; padding-bottom: 20px; @@ -12,7 +16,7 @@ body { } html { - scroll-padding-top: 60px; + scroll-padding-top: var(--navbar-height); } .jumbotron { @@ -90,7 +94,7 @@ html { .navbar { background: #3071a9; border-bottom: 0px; - height: 60px; + height: var(--navbar-height); box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.4); } @@ -552,7 +556,7 @@ a.anchor { } .navbar-collapse.collapse { - max-height: 60px; + max-height: var(--navbar-height); } .navbar-inverse .navbar-nav a .caret,