Skip to content

Commit 8b8eee6

Browse files
Merge pull request #345 from GuillaumeGomez/top-navbar
Fix top navbar
2 parents c98ae30 + c06ce24 commit 8b8eee6

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

templates/style.scss

+35-1
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,42 @@ div.rustdoc {
5252
font-family: $font-family-serif;
5353
padding: 10px 15px 20px 15px;
5454

55+
@media (max-width: 700px) {
56+
padding-top: 0;
57+
}
58+
5559
.sidebar {
56-
padding-top: 32px;
60+
@media (min-width: 701px) {
61+
padding-top: 32px;
62+
}
63+
5764
.block > ul > li {
5865
margin-right: -10px;
5966
}
6067
}
6168

69+
#source-sidebar {
70+
top: 32px;
71+
}
72+
73+
#sidebar-toggle {
74+
top: 62px;
75+
}
76+
77+
@media (max-width: 700px) {
78+
.sidebar.mobile {
79+
top: 32px;
80+
81+
.sidebar-elems.show-it {
82+
top: 77px;
83+
}
84+
85+
#sidebar-filler {
86+
top: 32px;
87+
}
88+
}
89+
}
90+
6291
// this is actual fix for docs.rs navigation and rustdoc sidebar
6392
position: absolute;
6493
left: 0;
@@ -69,6 +98,8 @@ div.rustdoc {
6998
body {
7099
padding: 0;
71100
margin: 0;
101+
// Since top navbar is fixed, we need to add padding to the body content.
102+
padding-top: 32px;
72103
}
73104

74105

@@ -114,11 +145,14 @@ div.container-rustdoc {
114145
}
115146

116147
div.nav-container {
148+
// Nothing is supposed to be over or hovering the top navbar. Maybe add a few others '('? :)
149+
z-index: 999;
117150
height: 32px;
118151
border-bottom: 1px solid $color-border;
119152
background-color: #fff;
120153
left: 0;
121154
right: 0;
155+
top: 0;
122156
position: fixed;
123157

124158
li {

0 commit comments

Comments
 (0)