about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-11-16 22:52:30 -0700
committerMichael Howell <michael@notriddle.com>2022-11-16 22:57:08 -0700
commitebee589bc085f0ac5750369cd4ee4c6a6b49f9dd (patch)
treeff84766aedb543e1f692a3734ba280e0da019fd6
parent251831ece9601d64172127b6caae9087358c2386 (diff)
downloadrust-ebee589bc085f0ac5750369cd4ee4c6a6b49f9dd.tar.gz
rust-ebee589bc085f0ac5750369cd4ee4c6a6b49f9dd.zip
rustdoc: clean up sidebar width CSS
This commit takes advantage of the ability to set [flex-basis] to a specific
length instead of setting it to `auto` and changing min-/max-width, and
setting flex-grow/-shrink both to 0.

[flex-basis]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 9b1cac85cfd..6d34183bd01 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -387,8 +387,7 @@ img {
 
 .sidebar {
 	font-size: 0.875rem;
-	width: 200px;
-	min-width: 200px;
+	flex: 0 0 200px;
 	overflow-y: scroll;
 	position: sticky;
 	height: 100vh;
@@ -397,12 +396,7 @@ img {
 }
 
 .rustdoc.source .sidebar {
-	width: 50px;
-	min-width: 0px;
-	max-width: 300px;
-	flex-grow: 0;
-	flex-shrink: 0;
-	flex-basis: auto;
+	flex-basis: 50px;
 	border-right: 1px solid;
 	overflow-x: hidden;
 	/* The sidebar is by default hidden  */
@@ -423,7 +417,7 @@ img {
 
 .source-sidebar-expanded .source .sidebar {
 	overflow-y: auto;
-	width: 300px;
+	flex-basis: 300px;
 }
 
 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
@@ -1702,6 +1696,7 @@ in storage.js
 		z-index: 11;
 		/* Reduce height slightly to account for mobile topbar. */
 		height: calc(100vh - 45px);
+		width: 200px;
 	}
 
 	/* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,