about summary refs log tree commit diff
path: root/src/librustdoc/html/static/rustdoc.css
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-04 07:00:19 +0000
committerbors <bors@rust-lang.org>2018-12-04 07:00:19 +0000
commit596e10fd3221e50e6cdb182b3ad76cc6d660f170 (patch)
treefa59c224d3b1c52eba2964e3ed54fe23b84643f6 /src/librustdoc/html/static/rustdoc.css
parent91d5d56c00d8e2926ccf856f14a4e52ef480d039 (diff)
parent82a7b6fde819e7e402ea9be6af14fe2c1575950e (diff)
downloadrust-596e10fd3221e50e6cdb182b3ad76cc6d660f170.tar.gz
rust-596e10fd3221e50e6cdb182b3ad76cc6d660f170.zip
Auto merge of #55707 - GuillaumeGomez:file-sidebar, r=QuietMisdreavus
Add source file sidebar

This is just a start currently but that gives a good overview of what it'll look like:

<img width="1440" alt="screenshot 2018-11-06 at 01 39 15" src="https://user-images.githubusercontent.com/3050060/48035592-05336180-e165-11e8-82e1-5ead0c345eb9.png">

r? @QuietMisdreavus
Diffstat (limited to 'src/librustdoc/html/static/rustdoc.css')
-rw-r--r--src/librustdoc/html/static/rustdoc.css74
1 files changed, 70 insertions, 4 deletions
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index c50c968f360..b6242457ae2 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -113,7 +113,8 @@ h3.impl, h3.method, h3.type {
 
 h1, h2, h3, h4,
 .sidebar, a.source, .search-input, .content table :not(code)>a,
-.collapse-toggle, div.item-list .out-of-band {
+.collapse-toggle, div.item-list .out-of-band,
+#source-sidebar, #sidebar-toggle {
 	font-family: "Fira Sans", sans-serif;
 }
 
@@ -668,9 +669,9 @@ a {
 	padding-right: 10px;
 }
 .content .search-results td:first-child a:after {
-    clear: both;
-    content: "";
-    display: block;
+	clear: both;
+	content: "";
+	display: block;
 }
 .content .search-results td:first-child a span {
 	float: left;
@@ -1459,3 +1460,68 @@ kbd {
 .non-exhaustive {
 	margin-bottom: 1em;
 }
+
+#sidebar-toggle {
+	position: fixed;
+	top: 30px;
+	left: 300px;
+	z-index: 10;
+	padding: 3px;
+	border-top-right-radius: 3px;
+	border-bottom-right-radius: 3px;
+	cursor: pointer;
+	font-weight: bold;
+	transition: left .5s;
+	font-size: 1.2em;
+	border: 1px solid;
+	border-left: 0;
+}
+#source-sidebar {
+	position: fixed;
+	top: 0;
+	bottom: 0;
+	left: 0;
+	width: 300px;
+	z-index: 1;
+	overflow: auto;
+	transition: left .5s;
+	border-right: 1px solid;
+}
+#source-sidebar > .title {
+	font-size: 1.5em;
+	text-align: center;
+	border-bottom: 1px solid;
+	margin-bottom: 6px;
+}
+
+div.children {
+	padding-left: 27px;
+	display: none;
+}
+div.name {
+	cursor: pointer;
+	position: relative;
+	margin-left: 16px;
+}
+div.files > a {
+	display: block;
+	padding: 0 3px;
+}
+div.files > a:hover, div.name:hover {
+	background-color: #a14b4b;
+}
+div.name.expand + .children {
+	display: block;
+}
+div.name::before {
+	content: "\25B6";
+	padding-left: 4px;
+	font-size: 0.7em;
+	position: absolute;
+	left: -16px;
+	top: 4px;
+}
+div.name.expand::before {
+	transform: rotate(90deg);
+	left: -14px;
+}