Web: Scroll hash-fragment links with navbar height (#7456)

Previously, hash-fragment links like this:
http://mark-t510:9090/targets#job-alertmanager

Would scroll to have the header at the top, obscured by the nav bar.

Tested in both old and new UIs.

Fixes #7434

Signed-off-by: Mark Hansen <markhansen@google.com>
This commit is contained in:
Mark Hansen 2020-06-27 17:12:11 +10:00 committed by GitHub
parent d17d88935c
commit f0a439bfc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -1,3 +1,9 @@
html {
/* https://github.com/prometheus/prometheus/issues/7434 */
/* Scroll to hash-fragment-links counting the fixed navbar 40px tall with 16px padding */
scroll-padding-top: 56px;
}
.panel {
margin-bottom: 20px;
}

View file

@ -1,3 +1,9 @@
html {
/* https://github.com/prometheus/prometheus/issues/7434 */
/* Scroll to hash-fragment-links counting the fixed navbar 40px tall + 16px padding */
scroll-padding-top: 56px;
}
/* Move down content because we have a fixed navbar that is 50px tall with 20px padding */
body {
padding-top: 70px;