Skip to content

Commit 04dcf93

Browse files
Merge pull request #9572 from circleci/DOCSS-1902-fix-scroll
Fix scroll jumper to account for header correctly
2 parents 65846c4 + 4aec353 commit 04dcf93

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ui/src/css/doc.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
hyphens: none;
2929
line-height: 1.3;
3030
margin: 1rem 0 0;
31+
scroll-margin-top: calc(var(--navbar-height) + var(--toolbar-height) + 1rem); /* Account for sticky header height */
3132
}
3233

3334
.doc > h1.page:first-child {

ui/src/js/03-fragment-jumper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
var article = document.querySelector('article.doc')
55
if (!article) return
6-
var toolbar = document.querySelector('.toolbar')
6+
var toolbar = document.querySelector('header') || document.querySelector('.toolbar')
77
var supportsScrollToOptions = 'scrollTo' in document.documentElement
88

99
function decodeFragment (hash) {

0 commit comments

Comments
 (0)