Skip to content

Fix anchors display in rustdoc #87818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -735,17 +735,21 @@ a {
.anchor {
display: none;
position: absolute;
left: -7px;
left: 0;
background: none !important;
}
.anchor.field {
left: -5px;
}
.small-section-header > .anchor {
left: -28px;
padding-right: 10px; /* avoid gap that causes hover to disappear */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried out this change locally, and it all looks good, except that the gap that causes the hover to disappear has cropped up in the new version. Is it possible to get rid of the gap?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gap only appears with headers like Implementations, not with enum variants.

left: -15px;
padding-right: 8px;
}
.anchor:before {
content: '\2002\00a7\2002';
h2.small-section-header > .anchor {
padding-right: 6px;
}
.anchor::before {
content: '§';
}

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