about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/rustdoc.css
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-02-13 09:41:41 +0000
committerbors <bors@rust-lang.org>2022-02-13 09:41:41 +0000
commitc26fbf857f82b2d0cb919c633ba0e3a90e5b9426 (patch)
treec515ffd580374f6b3c0ff4e4052aba218089bb9a /src/librustdoc/html/static/css/rustdoc.css
parent9a60099cc43c8a07abb280be323d1ed9afc27f2c (diff)
parent0b22d4170eddc179680c0da4415fab721e02f85a (diff)
downloadrust-c26fbf857f82b2d0cb919c633ba0e3a90e5b9426.tar.gz
rust-c26fbf857f82b2d0cb919c633ba0e3a90e5b9426.zip
Auto merge of #93763 - jsha:re-space-empty-impls, r=GuillaumeGomez
rustdoc: fix spacing of non-toggled impl blocks

We [recently removed the "up here" arrows on item-infos](https://github.com/rust-lang/rust/pull/92651), and adjusted
vertical spacing so that even without the arrow, it would be visually
clear which item the item-info belonged to. The new CSS styles for
vertical spacing only applied to toggles, though. This missed
non-toggled impl blocks - for instance, those without any methods, like
https://doc.rust-lang.org/nightly/std/marker/trait.Send.html#implementors.
The result was lists of implementors that were spaced too closely. This
PR fixes the spacing by making it apply to non-toggled impl blocks as
well.

This also fixes an issue where item-infos were displayed too far below
their items. That was a result of display: table on .item-info .stab.
Changed that to display: inline-block.

Demo: https://rustdoc.crud.net/jsha/re-space-empty-impls/std/marker/trait.Send.html

Before:

<img width=300 src="https://user-images.githubusercontent.com/220205/152954394-ec0b80e7-2573-4f06-9d7a-7b10b8ceac60.png">

After:

<img width=300 src="https://user-images.githubusercontent.com/220205/152954228-abac1d30-a76d-4ab1-89ec-ef7549fe8c9c.png">

r? `@GuillaumeGomez`
Diffstat (limited to 'src/librustdoc/html/static/css/rustdoc.css')
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 78e7c97d71d..4327a554fc6 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1041,7 +1041,7 @@ body.blur > :not(#help) {
 }
 
 .item-info .stab {
-	display: table;
+	display: inline-block;
 }
 .stab {
 	padding: 3px;
@@ -2018,7 +2018,8 @@ details.rustdoc-toggle[open] > summary.hideme::after {
 }
 
 .method-toggle summary,
-.implementors-toggle summary {
+.implementors-toggle summary,
+.impl {
 	margin-bottom: 0.75em;
 }