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-10-19 21:38:39 +0200
committerGitHub <noreply@github.com>2022-10-19 21:38:39 +0200
commit433f736b86e67cea31fb4e72b092ec9b0364936c (patch)
tree9dd8db6d0e3d1e0026755efca7c9c4747223f9a7 /src/librustdoc/html/static/css/rustdoc.css
parent4b8f4319954ff2642690b9e5cbe4af352d095bf6 (diff)
parenta01b88575e2ee7646c46fa02a94abf8cd2d33fed (diff)
downloadrust-433f736b86e67cea31fb4e72b092ec9b0364936c.tar.gz
rust-433f736b86e67cea31fb4e72b092ec9b0364936c.zip
Rollup merge of #103211 - notriddle:notriddle/dot-location, r=GuillaumeGomez
rustdoc: remove class name `location` from sidebar sibling nav

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-location/std/vec/struct.Vec.html

This change tweaks the CSS to apply most of its styles to `.sidebar h2`, cleaning up a few redundant rules from `.mobile-topbar .location` and restoring useful navigation aids in mobile mode.

## Before

![location-before](https://user-images.githubusercontent.com/1593513/196521014-d8730830-c3a2-4ed7-9266-05454cd31e05.png)

## After

![location-after](https://user-images.githubusercontent.com/1593513/196521020-75ec1fa5-b3dc-4c5d-97b6-afccb5fbe00a.png)
Diffstat (limited to 'src/librustdoc/html/static/css/rustdoc.css')
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css43
1 files changed, 18 insertions, 25 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 7b6f52b0acf..b4408e64740 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -171,7 +171,7 @@ h1.fqn {
 	 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
 	Underlines elsewhere in the documentation break up visual flow and tend to invert
 	section hierarchies. */
-h2,
+.content h2,
 .top-doc .docblock > h3,
 .top-doc .docblock > h4 {
 	border-bottom: 1px solid var(--headings-border-bottom-color);
@@ -397,15 +397,6 @@ img {
 	left: 0;
 }
 
-.sidebar-elems,
-.sidebar > .location {
-	padding-left: 24px;
-}
-
-.sidebar .location {
-	overflow-wrap: anywhere;
-}
-
 .rustdoc.source .sidebar {
 	width: 50px;
 	min-width: 0px;
@@ -505,8 +496,8 @@ ul.block, .block li {
 }
 
 .block a,
-.sidebar h3 a,
-h2.location a {
+.sidebar h2 a,
+.sidebar h3 a {
 	display: block;
 	padding: 0.25rem;
 	margin-left: -0.25rem;
@@ -516,8 +507,7 @@ h2.location a {
 }
 
 .sidebar h2 {
-	border-bottom: none;
-	font-weight: 500;
+	overflow-wrap: anywhere;
 	padding: 0;
 	margin: 0;
 	margin-top: 0.7rem;
@@ -526,11 +516,15 @@ h2.location a {
 
 .sidebar h3 {
 	font-size: 1.125rem; /* 18px */
-	font-weight: 500;
 	padding: 0;
 	margin: 0;
 }
 
+.sidebar-elems,
+.sidebar > h2 {
+	padding-left: 24px;
+}
+
 .sidebar a, .sidebar .current {
 	color: var(--sidebar-link-color);
 }
@@ -1788,18 +1782,10 @@ in storage.js
 		width: 0;
 	}
 
-	.mobile-topbar .location a {
-		padding: 0;
-		margin: 0;
-	}
-
-	.mobile-topbar .location {
-		border: none;
-		padding: 0;
+	.mobile-topbar h2 {
+		padding-bottom: 0;
 		margin: auto 0.5em auto auto;
-		text-overflow: ellipsis;
 		overflow: hidden;
-		white-space: nowrap;
 		/* Rare exception to specifying font sizes in rem. Since the topbar
 		   height is specified in pixels, this also has to be specified in
 		   pixels to avoid overflowing the topbar when the user sets a bigger
@@ -1807,6 +1793,13 @@ in storage.js
 		font-size: 24px;
 	}
 
+	.mobile-topbar h2 a {
+		display: block;
+		text-overflow: ellipsis;
+		overflow: hidden;
+		white-space: nowrap;
+	}
+
 	.mobile-topbar .logo-container {
 		max-height: 45px;
 	}