From a10d01be22819f21ae0011390f71fa3c3902d1e4 Mon Sep 17 00:00:00 2001 From: Tor Hovland Date: Tue, 20 Apr 2021 22:31:48 +0200 Subject: [PATCH 1/2] Uses flex to fix formatting of h1 at any width. --- src/librustdoc/html/static/rustdoc.css | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 8f11dda2fb205..415bb608911e5 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -116,6 +116,9 @@ h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { padding-bottom: 6px; } h1.fqn { + display: flex; + gap: 8px; + width: 100%; border-bottom: 1px dashed; margin-top: 0; } @@ -458,6 +461,12 @@ nav.sub { font-weight: normal; } +h1.fqn > .out-of-band { + float: unset; + flex: 1; + text-align: right; +} + h3.impl > .out-of-band { font-size: 21px; } @@ -1450,10 +1459,6 @@ h4 > .notable-traits { padding: 0; } - .content .in-band { - width: 100%; - } - .content h4 > .out-of-band { position: inherit; } From bb91805acefa32c2aedb769b1afe1f154b8e5dca Mon Sep 17 00:00:00 2001 From: Tor Hovland Date: Wed, 21 Apr 2021 21:33:48 +0200 Subject: [PATCH 2/2] Replaced flex gap with margin, for compatibility with older browsers. --- src/librustdoc/html/static/rustdoc.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 415bb608911e5..213ca9ec9e3ea 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -117,7 +117,6 @@ h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { } h1.fqn { display: flex; - gap: 8px; width: 100%; border-bottom: 1px dashed; margin-top: 0; @@ -465,6 +464,7 @@ h1.fqn > .out-of-band { float: unset; flex: 1; text-align: right; + margin-left: 8px; } h3.impl > .out-of-band {