Skip to content

Commit d16d44f

Browse files
authored
Unrolled build for rust-lang#122693
Rollup merge of rust-lang#122693 - ehuss:rust-css-header, r=GuillaumeGomez Fix heading anchors in doc pages. This fixes the heading anchors on the standalone doc pages (the index, releases, etc.) so that the § symbol is only shown when the user hovers over the heading. This was changed in rust-lang#117662, but this CSS was not updated.
2 parents d31b6fb + 39f2d25 commit d16d44f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: src/doc/rust.css

+22
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,28 @@ h1 a:link, h1 a:visited, h2 a:link, h2 a:visited,
136136
h3 a:link, h3 a:visited, h4 a:link, h4 a:visited,
137137
h5 a:link, h5 a:visited {color: black;}
138138

139+
h1, h2, h3, h4, h5 {
140+
/* This is needed to be able to position the doc-anchor. Ideally there
141+
would be a <div> around the whole document, but we don't have that. */
142+
position: relative;
143+
}
144+
145+
a.doc-anchor {
146+
color: black;
147+
display: none;
148+
position: absolute;
149+
left: -20px;
150+
/* We add this padding so that when the cursor moves from the heading's text to the anchor,
151+
the anchor doesn't disappear. */
152+
padding-right: 5px;
153+
/* And this padding is used to make the anchor larger and easier to click on. */
154+
padding-left: 3px;
155+
}
156+
*:hover > .doc-anchor {
157+
display: block;
158+
}
159+
160+
139161
/* Code */
140162

141163
pre, code {

0 commit comments

Comments
 (0)