Skip to content

Commit

Permalink
Rollup merge of rust-lang#40265 - wesleywiser:rustdoc_style, r=Guilla…
Browse files Browse the repository at this point in the history
…umeGomez

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)
  • Loading branch information
Ariel Ben-Yehuda authored Mar 8, 2017
2 parents f38e332 + 2bb2a29 commit 5694ac9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ nav.sub {
position: absolute;
left: 0;
top: 0;
min-height: 100%;
min-height: 100vh;
}

.sidebar .current {
margin-right: -20px;
}

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

.sidebar .location {
border: 1px solid;
font-size: 17px;
margin: 30px 0 20px 0;
text-align: center;
}

.location:empty {
border: none;
}

.location a:first-child { font-weight: 500; }

.block {
Expand Down
11 changes: 10 additions & 1 deletion src/librustdoc/html/static/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,17 @@ pre {
background-color: #F5F5F5;
}

.sidebar {
background-color: #F1F1F1;
}

.sidebar .current {
background-color: #fff;
}

.sidebar .location {
background: #e1e1e1;
border-color: #000;
background-color: #fff;
color: #333;
}

Expand Down

0 comments on commit 5694ac9

Please sign in to comment.