about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2021-07-15 22:06:53 +0200
committerPietro Albini <pietro.albini@ferrous-systems.com>2021-07-26 12:45:58 +0200
commite722a08eb8b151a34755495e7ca4438b0a46ed81 (patch)
tree80a1ac9c2a018d4d9c78cd43584d775d7d446134
parent26210a3558e1bd78c94376d90c5bf9e07d932511 (diff)
downloadrust-e722a08eb8b151a34755495e7ca4438b0a46ed81.tar.gz
rust-e722a08eb8b151a34755495e7ca4438b0a46ed81.zip
Do not hide the sidebar on mobile, move it outside of the viewport instead
-rw-r--r--src/librustdoc/html/static/rustdoc.css10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index d8684641a30..b88e4ac5c28 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -1577,15 +1577,18 @@ details.undocumented[open] > summary::before {
 		display: none;
 	}
 
+	/* We do NOT hide this element so that alternative device readers still have this information
+	   available. */
 	.sidebar-elems {
 		position: fixed;
 		z-index: 1;
-		left: 0;
 		top: 45px;
 		bottom: 0;
+		width: 246px;
+		/* We move the sidebar to the left by its own width so it doesn't appear. */
+		left: -246px;
 		overflow-y: auto;
 		border-right: 1px solid;
-		display: none;
 	}
 
 	.sidebar > .block.version {
@@ -1662,8 +1665,7 @@ details.undocumented[open] > summary::before {
 	}
 
 	.show-it {
-		display: block;
-		width: 246px;
+		left: 0;
 	}
 
 	.show-it > .block.items {