Skip to content

Commit

Permalink
Rollup merge of #74635 - GuillaumeGomez:fix-tooltip-pos, r=Manishearth
Browse files Browse the repository at this point in the history
Fix tooltip position if the documentation starts with a code block

Fixes #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
  • Loading branch information
Manishearth authored Jul 22, 2020
2 parents 3de0de1 + 96225b1 commit 05a2466
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,16 @@ h4 > .important-traits {

/* Media Queries */

@media (min-width: 701px) {
/* In case there is no documentation before a code block, we need to add some margin at the top
to prevent an overlay between the "collapse toggle" and the information tooltip.
However, it's needed needed with smaller screen width because the doc/code block is always put
"one line" below. */
.information:first-child > .tooltip {
margin-top: 16px;
}
}

@media (max-width: 700px) {
body {
padding-top: 0px;
Expand Down

0 comments on commit 05a2466

Please sign in to comment.