Skip to content

Commit 05a2466

Browse files
authored
Rollup merge of rust-lang#74635 - GuillaumeGomez:fix-tooltip-pos, r=Manishearth
Fix tooltip position if the documentation starts with a code block Fixes rust-lang#74321. Before: ![before](https://user-images.githubusercontent.com/3050060/88188970-cf842400-cc38-11ea-839b-37e41656837d.png) After: ![after](https://user-images.githubusercontent.com/3050060/88188981-d3b04180-cc38-11ea-8194-713ffe640d3a.png) And in case there is text, it is not being applied: ![after-witness](https://user-images.githubusercontent.com/3050060/88189009-ddd24000-cc38-11ea-9f0a-61dfd0a0cbd0.png) And on mobile it isn't needed so it's not "activated": ![Screenshot from 2020-07-22 17-17-43](https://user-images.githubusercontent.com/3050060/88194698-65bb4880-cc3f-11ea-8513-0043ccca8cfc.png) r? @rust-lang/rustdoc
2 parents 3de0de1 + 96225b1 commit 05a2466

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/librustdoc/html/static/rustdoc.css

+10
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,16 @@ h4 > .important-traits {
12911291

12921292
/* Media Queries */
12931293

1294+
@media (min-width: 701px) {
1295+
/* In case there is no documentation before a code block, we need to add some margin at the top
1296+
to prevent an overlay between the "collapse toggle" and the information tooltip.
1297+
However, it's needed needed with smaller screen width because the doc/code block is always put
1298+
"one line" below. */
1299+
.information:first-child > .tooltip {
1300+
margin-top: 16px;
1301+
}
1302+
}
1303+
12941304
@media (max-width: 700px) {
12951305
body {
12961306
padding-top: 0px;

0 commit comments

Comments
 (0)