Skip to content

Commit 2bb2a29

Browse files
committed
Improve the style of the sidebar in rustdoc output
Makes the sidebar a light grey and highlights the currently viewed item in the sidebar more prominently. All visual design credit goes to @johnwhelchel (#37856)
1 parent ba07bd5 commit 2bb2a29

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/librustdoc/html/static/rustdoc.css

+10-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ nav.sub {
167167
position: absolute;
168168
left: 0;
169169
top: 0;
170-
min-height: 100%;
170+
min-height: 100vh;
171+
}
172+
173+
.sidebar .current {
174+
margin-right: -20px;
171175
}
172176

173177
.content, nav { max-width: 960px; }
@@ -185,11 +189,16 @@ nav.sub {
185189
}
186190

187191
.sidebar .location {
192+
border: 1px solid;
188193
font-size: 17px;
189194
margin: 30px 0 20px 0;
190195
text-align: center;
191196
}
192197

198+
.location:empty {
199+
border: none;
200+
}
201+
193202
.location a:first-child { font-weight: 500; }
194203

195204
.block {

src/librustdoc/html/static/styles/main.css

+10-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,17 @@ pre {
3737
background-color: #F5F5F5;
3838
}
3939

40+
.sidebar {
41+
background-color: #F1F1F1;
42+
}
43+
44+
.sidebar .current {
45+
background-color: #fff;
46+
}
47+
4048
.sidebar .location {
41-
background: #e1e1e1;
49+
border-color: #000;
50+
background-color: #fff;
4251
color: #333;
4352
}
4453

0 commit comments

Comments
 (0)