about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-09-15 08:00:17 +0200
committerGitHub <noreply@github.com>2022-09-15 08:00:17 +0200
commite6aef7bf38448981bb16a2e428ae1f4a9c691e3b (patch)
tree20b34eb806a05a8f8cdd91d8218b6fdd51ef4438 /src
parentb71b640f3c36721fde44e9add8e463f2973356e0 (diff)
parent44d9b8d07014d976c88f541dbe0af37e64e37bdd (diff)
downloadrust-e6aef7bf38448981bb16a2e428ae1f4a9c691e3b.tar.gz
rust-e6aef7bf38448981bb16a2e428ae1f4a9c691e3b.zip
Rollup merge of #101812 - notriddle:notriddle/titles-button, r=GuillaumeGomez
rustdoc: clean up CSS `#titles` using flexbox

This commit allows it to stop manually specifying pixel heights for the tabs on search result pages. There's less messing with manual breakpoints and less complex CSS selectors.

# Before

![image](https://user-images.githubusercontent.com/1593513/190215034-253c0f58-07c6-41c9-8848-0442c0522070.png)

# After

![image](https://user-images.githubusercontent.com/1593513/190215065-d2453dca-edf0-4353-8fc8-3a3b31f03892.png)
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index f9f2a48cdc2..c3f8a3a7f45 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1365,27 +1365,19 @@ pre.rust {
 }
 
 #titles {
-	height: 35px;
+	display: flex;
+	flex-direction: row;
+	gap: 1px;
+	margin-bottom: 4px;
 }
 
 #titles > button {
-	float: left;
-	width: 33.3%;
 	text-align: center;
 	font-size: 1.125rem;
 	cursor: pointer;
 	border: 0;
 	border-top: 2px solid;
-}
-
-#titles > button:first-child:last-child {
-	margin-right: 1px;
-	width: calc(100% - 1px);
-}
-
-#titles > button:not(:last-child) {
-	margin-right: 1px;
-	width: calc(33.3% - 1px);
+	flex: 1;
 }
 
 #titles > button > div.count {
@@ -1882,12 +1874,7 @@ in storage.js plus the media query with (min-width: 701px)
 	}
 
 	#titles > button > div.count {
-		float: left;
-		width: 100%;
-	}
-
-	#titles {
-		height: 50px;
+		display: block;
 	}
 
 	/* Because of ios, we need to actually have a full height sidebar title so the
@@ -2018,10 +2005,6 @@ in storage.js plus the media query with (min-width: 701px)
 }
 
 @media (max-width: 464px) {
-	#titles, #titles > button {
-		height: 73px;
-	}
-
 	#crate-search {
 		border-radius: 4px;
 	}