File tree 1 file changed +19
-3
lines changed
src/librustdoc/html/static/css
1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -768,14 +768,30 @@ nav.sub {
768
768
h2 .small-section-header > .anchor {
769
769
padding-right : 6px ;
770
770
}
771
- .doc-anchor {
772
- margin-right : 6px ;
771
+ a .doc-anchor {
772
+ color : var (--main-color );
773
+ display : none;
774
+ position : absolute;
775
+ left : -17px ;
776
+ /* We add this padding so that when the cursor moves from the heading's text to the anchor,
777
+ the anchor doesn't disappear. */
778
+ padding-right : 5px ;
779
+ /* And this padding is used to make the anchor larger and easier to click on. */
780
+ padding-left : 3px ;
781
+ }
782
+ * : hover > .doc-anchor {
783
+ display : block;
784
+ }
785
+ /* If the first element of the top doc block is a heading, we don't want to ever display its anchor
786
+ because of the `[-]` element which would overlap with it. */
787
+ .top-doc > .docblock > * : first-child > .doc-anchor {
788
+ display : none !important ;
773
789
}
774
790
775
791
.main-heading a : hover ,
776
792
.example-wrap .rust a : hover ,
777
793
.all-items a : hover ,
778
- .docblock a : not (.test-arrow ): not (.scrape-help ): not (.tooltip ): hover ,
794
+ .docblock a : not (.test-arrow ): not (.scrape-help ): not (.tooltip ): hover : not (. doc-anchor ) ,
779
795
.docblock-short a : not (.test-arrow ): not (.scrape-help ): not (.tooltip ): hover ,
780
796
.item-info a {
781
797
text-decoration : underline;
You can’t perform that action at this time.
0 commit comments