Skip to content

Commit 565d3a8

Browse files
authored
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 8846c08, 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)
2 parents 3cecc78 + b707eff commit 565d3a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustdoc/html/static/css/rustdoc.css

+7
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ h1, h2, h3, h4 {
138138
.docblock h3, .docblock h4, h5, h6 {
139139
margin: 15px 0 5px 0;
140140
}
141+
.docblock > h2:first-child,
142+
.docblock > h3:first-child,
143+
.docblock > h4:first-child,
144+
.docblock > h5:first-child,
145+
.docblock > h6:first-child {
146+
margin-top: 0;
147+
}
141148
h1.fqn {
142149
margin: 0;
143150
padding: 0;

0 commit comments

Comments
 (0)