Skip to content

Commit 13869f4

Browse files
committed
Move rule links in the presence of » b/c of linked headers
1 parent 1f9ea21 commit 13869f4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

theme/reference.css

+10-3
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,18 @@ main > .rule {
298298
navigate to it. This adds an indicator that the linked rule is the one that
299299
is "current", just like normal headers are in mdbook.
300300
*/
301-
.rule:target::before {
301+
.rule:target a span::before {
302302
display: inline-block;
303303
content: "»";
304-
margin-inline-start: -20px;
305-
width: 20px;
304+
padding-right: 5px;
305+
}
306+
307+
/* Dodge » from headings */
308+
.rule:has(+ h1:target),
309+
.rule:has(+ h2:target),
310+
.rule:has(+ h3:target),
311+
.rule:has(+ h4:target) {
312+
padding-right: 24px;
306313
}
307314

308315
/* Hide the rules if the width of the container is too small.

0 commit comments

Comments
 (0)