about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-09-29 10:15:18 -0700
committerGitHub <noreply@github.com>2022-09-29 10:15:18 -0700
commit565d3a8c89673b64c1d5b66001d3ac8f4e4d275f (patch)
tree5ae35e7d328e25174f8ea90677f02280c0647d2a
parent3cecc78694869d05ea0947780bcd5cbd9035504b (diff)
parentb707eff5cc8780b535b0d2f170fe886f927c5082 (diff)
downloadrust-565d3a8c89673b64c1d5b66001d3ac8f4e4d275f.tar.gz
rust-565d3a8c89673b64c1d5b66001d3ac8f4e4d275f.zip
Rollup merge of #102437 - notriddle:notriddle/margin-top-h2, r=jsha
rustdoc: cut margin-top from first header in docblock

Fixes a regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee, where a header's top margin used to be collapsed, but isn't any more.

## Before

![image](https://user-images.githubusercontent.com/1593513/192893092-8e158bf7-ae18-41ef-8f11-6f34c724d345.png)

## After

![image](https://user-images.githubusercontent.com/1593513/192893139-d6ee06bf-9c0b-4194-bd5d-636312c89367.png)
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 7bc8fbb1ea7..be8af35a7e4 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -138,6 +138,13 @@ h1, h2, h3, h4 {
 .docblock h3, .docblock h4, h5, h6 {
 	margin: 15px 0 5px 0;
 }
+.docblock > h2:first-child,
+.docblock > h3:first-child,
+.docblock > h4:first-child,
+.docblock > h5:first-child,
+.docblock > h6:first-child {
+	margin-top: 0;
+}
 h1.fqn {
 	margin: 0;
 	padding: 0;