Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Fix trait method anchor disappearing before user can click on it
  • Loading branch information
GuillaumeGomez committed Jan 8, 2026
commit c502d7fce0e057eee00bfab471360ea751ef3762
4 changes: 3 additions & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1200,9 +1200,11 @@ nav.sub {
display: initial;
}
.anchor {
--anchor-link-shift: 0.5em;
display: none;
position: absolute;
left: -0.5em;
left: calc(var(--anchor-link-shift) * -1);
padding-right: var(--anchor-link-shift);
background: none !important;
}
.anchor.field {
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-gui/anchor-navigable.goml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// We check that ".item-info" is bigger than its content.
move-cursor-to: ".impl"
assert-property: (".impl > a.anchor", {"offsetWidth": "8"})
assert-property: (".impl > a.anchor", {"offsetWidth": "16"})
assert-css: (".impl > a.anchor", {"left": "-8px"})