about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-30 19:53:20 +0100
committerGitHub <noreply@github.com>2022-11-30 19:53:20 +0100
commite005d0406f61e9dd122166a8256ac9c96b827455 (patch)
treea647922cbc9dadfa66d184eed55ba1c6e42b7972
parent6c4b5a2bdbe2b7ea4590c4715b9ede4a95e665c5 (diff)
parent3a61ab61169984c3efbf5c4c3e3765591f83db72 (diff)
Rollup merge of #105086 - notriddle:notriddle/sidebar-css, r=GuillaumeGomez
rustdoc: clean up sidebar link CSS

Group `text-overflow: ellipses` along with `white-space: nowrap`. It makes no sense to try to apply it to links with `overflow-wrap: anywhere`, because it can't actually make ellipses when that's turned on.

Simplify the selector for the 25rem left padding on sidebar links, to match up with the style for the container left padding that makes room for it.
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index a3a90f5a58b..02a51312e8f 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -480,15 +480,11 @@ ul.block, .block li {
 	list-style: none;
 }
 
-.block a,
-.sidebar h2 a,
-.sidebar h3 a {
+.sidebar-elems a,
+.sidebar > h2 a {
 	display: block;
-	padding: 0.25rem;
+	padding: 0.25rem; /* 4px */
 	margin-left: -0.25rem;
-
-	text-overflow: ellipsis;
-	overflow: hidden;
 }
 
 .sidebar h2 {
@@ -522,6 +518,8 @@ ul.block, .block li {
 
 .sidebar-elems .block li a {
 	white-space: nowrap;
+	text-overflow: ellipsis;
+	overflow: hidden;
 }
 
 .mobile-topbar {