Skip to content

Commit 6d30039

Browse files
committed
Auto merge of rust-lang#87818 - GuillaumeGomez:anchors-display-rustdoc, r=camelid
Fix anchors display in rustdoc Fixes rust-lang#87611 (it simplifies the positioning and fix the background). ![Screenshot from 2021-08-06 16-47-03](https://user-images.githubusercontent.com/3050060/128531105-61d1c21f-4a4d-4d68-aedf-9bfe0332f8ae.png) ![Screenshot from 2021-08-06 16-47-10](https://user-images.githubusercontent.com/3050060/128531109-b2ea8065-10b0-4400-9507-322122e42e78.png) ![Screenshot from 2021-08-06 16-47-14](https://user-images.githubusercontent.com/3050060/128531111-8a17cbdb-29e8-4baa-a0d6-81aa4f6ac6ed.png) r? `@camelid`
2 parents 3d0774d + dc24f02 commit 6d30039

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -735,17 +735,21 @@ a {
735735
.anchor {
736736
display: none;
737737
position: absolute;
738-
left: -7px;
738+
left: 0;
739+
background: none !important;
739740
}
740741
.anchor.field {
741742
left: -5px;
742743
}
743744
.small-section-header > .anchor {
744-
left: -28px;
745-
padding-right: 10px; /* avoid gap that causes hover to disappear */
745+
left: -15px;
746+
padding-right: 8px;
746747
}
747-
.anchor:before {
748-
content: '\2002\00a7\2002';
748+
h2.small-section-header > .anchor {
749+
padding-right: 6px;
750+
}
751+
.anchor::before {
752+
content: '§';
749753
}
750754

751755
.docblock a:not(.srclink):not(.test-arrow):hover,

0 commit comments

Comments
 (0)