about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWesley Wiser <wwiser@gmail.com>2017-02-15 20:21:25 -0500
committerWesley Wiser <wwiser@gmail.com>2017-03-06 18:23:55 -0500
commit2bb2a2975f25e8ba7a372898e7e112f1cec5db01 (patch)
treeb54e128b862e680e548c5937649d6a52a9b567d1
parentba07bd5d23aced6d4baa5696213b11ca832c1a5d (diff)
downloadrust-2bb2a2975f25e8ba7a372898e7e112f1cec5db01.tar.gz
rust-2bb2a2975f25e8ba7a372898e7e112f1cec5db01.zip
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)
-rw-r--r--src/librustdoc/html/static/rustdoc.css11
-rw-r--r--src/librustdoc/html/static/styles/main.css11
2 files changed, 20 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index b0bf69b0181..6bd9cf6620b 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -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; }
@@ -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 {
diff --git a/src/librustdoc/html/static/styles/main.css b/src/librustdoc/html/static/styles/main.css
index 862d6d12b9a..f1e81900d1e 100644
--- a/src/librustdoc/html/static/styles/main.css
+++ b/src/librustdoc/html/static/styles/main.css
@@ -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;
 }