Skip to content

Commit 1aa32bc

Browse files
authored
Rollup merge of rust-lang#40265 - wesleywiser:rustdoc_style, r=GuillaumeGomez
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 (rust-lang#37856) Sample screenshots: ![screen shot 2017-03-04 at 12 29 48 pm](https://cloud.githubusercontent.com/assets/831192/23580829/db6c26c2-00d6-11e7-8d89-822e25ba79f0.png) ![screen shot 2017-03-04 at 12 30 10 pm](https://cloud.githubusercontent.com/assets/831192/23580828/db69eeca-00d6-11e7-9f89-1e06fd3bf098.png) ![screen shot 2017-03-04 at 12 30 31 pm](https://cloud.githubusercontent.com/assets/831192/23580830/db6d00ce-00d6-11e7-89ca-cd03e148a121.png)
2 parents 3ac1eaa + 2bb2a29 commit 1aa32bc

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)