about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/rustdoc.css
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-18 14:13:38 +0100
committerGitHub <noreply@github.com>2022-11-18 14:13:38 +0100
commit5977fbbc1c16aeecc511ef548833e7f00c90f266 (patch)
tree7855d00473f0cd84f661ee4cf29ad216cebb8710 /src/librustdoc/html/static/css/rustdoc.css
parent5a8bc0bfd04605d55041683d5ad06194e1507d77 (diff)
parentebee589bc085f0ac5750369cd4ee4c6a6b49f9dd (diff)
downloadrust-5977fbbc1c16aeecc511ef548833e7f00c90f266.tar.gz
rust-5977fbbc1c16aeecc511ef548833e7f00c90f266.zip
Rollup merge of #104516 - notriddle:notriddle/flex-basis-sidebar-width, r=GuillaumeGomez
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.

This PR should not cause any visual changes.

preview: https://notriddle.com/notriddle-rustdoc-demos/flex-basis-sidebar-width/std/index.html

[flex-basis]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis
Diffstat (limited to 'src/librustdoc/html/static/css/rustdoc.css')
-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 5ec2fe47e01..20efc23a53d 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -384,8 +384,7 @@ img {
 
 .sidebar {
 	font-size: 0.875rem;
-	width: 200px;
-	min-width: 200px;
+	flex: 0 0 200px;
 	overflow-y: scroll;
 	position: sticky;
 	height: 100vh;
@@ -394,12 +393,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  */
@@ -420,7 +414,7 @@ img {
 
 .source-sidebar-expanded .source .sidebar {
 	overflow-y: auto;
-	width: 300px;
+	flex-basis: 300px;
 }
 
 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
@@ -1701,6 +1695,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,