about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2022-11-26 17:47:25 +0100
committerGitHub <noreply@github.com>2022-11-26 17:47:25 +0100
commitd99201c3816aec764fc974de1ad888cd39755364 (patch)
tree77734696814d1d354353692b14c2b3aa581ec386
parentc4f8546fbc0eda7f861c04ecb57298fd679f2096 (diff)
parent8b001b4da0716936e0ca32303cc0e3c5e53e42f8 (diff)
downloadrust-d99201c3816aec764fc974de1ad888cd39755364.tar.gz
rust-d99201c3816aec764fc974de1ad888cd39755364.zip
Rollup merge of #104928 - notriddle:notriddle/sidebar-toggle-flexbox, r=GuillaumeGomez
rustdoc: use flexbox CSS to align sidebar button instead of position

This accomplishes the same thing with significantly less code.

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-toggle-flexbox/src/test_dingus/lib.rs.html
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 586462c0ef0..98a5b761ded 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1327,8 +1327,8 @@ a.test-arrow:hover {
 	border-bottom: 1px solid;
 	display: flex;
 	height: 40px;
-	justify-content: center;
-	align-items: center;
+	justify-content: stretch;
+	align-items: stretch;
 	z-index: 10;
 }
 #source-sidebar {
@@ -1356,13 +1356,7 @@ a.test-arrow:hover {
 	text-align: center;
 	border: none;
 	outline: none;
-	position: absolute;
-	top: 0;
-	bottom: 0;
-	left: 0;
-	right: 0;
-	/* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
-	width: 100%;
+	flex: 1 1;
 	/* iOS button gradient: https://stackoverflow.com/q/5438567 */
 	-webkit-appearance: none;
 	opacity: 1;