about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-01-25 23:06:01 +0100
committerGitHub <noreply@github.com>2022-01-25 23:06:01 +0100
commitc8999d9d91ebc10857b7e46dbda3b4f5b3d84f94 (patch)
treebf2a947e7ae837f13f076f49c43978d4f1046a49 /src/librustdoc/html/static/css
parent83cc776d7cdcb2bcd4ede77aed59b99582ec7b70 (diff)
parentabffd4af08ac3bc4ab91cfc83ad3055529e63d57 (diff)
downloadrust-c8999d9d91ebc10857b7e46dbda3b4f5b3d84f94.tar.gz
rust-c8999d9d91ebc10857b7e46dbda3b4f5b3d84f94.zip
Rollup merge of #93286 - jsha:sidebar-nowrap, r=GuillaumeGomez
Add white-space: nowrap to links in the sidebar

We already have overflow: hidden on these links, but if there is a possibility to wrap, they will wrap. This happens in particular for trait implementations because the punctuation (`<>, `) introduces opportunities for breaks. That produces inconsistent UI. Fix it by forcing them not to wrap.

Demo: https://rustdoc.crud.net/jsha/sidebar-nowrap/std/string/struct.String.html

To see the effect, scroll down to the "Trait Implementations" portion of the sidebar and look at IndexMut. Compare vs:

https://doc.rust-lang.org/std/string/struct.String.html
https://doc.rust-lang.org/nightly/std/string/struct.String.html

r? `@camelid`
Diffstat (limited to 'src/librustdoc/html/static/css')
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 645c0aba6ac..4c79218f62a 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -484,6 +484,10 @@ nav.sub {
 	overflow: hidden;
 }
 
+.sidebar-links a {
+	white-space: nowrap;
+}
+
 .sidebar h2 {
 	border-bottom: none;
 	font-weight: 500;