Skip to content

Commit e941001

Browse files
committed
[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.
1 parent e8d8db9 commit e941001

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎docs/assets/themes/zeppelin/css/style.css‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
@import url('../font/fonts-patua-one.css');
33
@import url('../font/fonts-open-sans.css');
44

5+
:root {
6+
--navbar-height: 60px;
7+
}
8+
59
body {
610
padding-top: 50px;
711
padding-bottom: 20px;
@@ -12,7 +16,7 @@ body {
1216
}
1317

1418
html {
15-
scroll-padding-top: 60px;
19+
scroll-padding-top: var(--navbar-height);
1620
}
1721

1822
.jumbotron {
@@ -90,7 +94,7 @@ html {
9094
.navbar {
9195
background: #3071a9;
9296
border-bottom: 0px;
93-
height: 60px;
97+
height: var(--navbar-height);
9498
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.4);
9599
}
96100

@@ -552,7 +556,7 @@ a.anchor {
552556
}
553557

554558
.navbar-collapse.collapse {
555-
max-height: 60px;
559+
max-height: var(--navbar-height);
556560
}
557561

558562
.navbar-inverse .navbar-nav a .caret,

0 commit comments

Comments
 (0)