Skip to content

Commit 60b5f6d

Browse files
committed
rustdoc: add visible focus outline to rustdoc-toggle
The change in opacity is inconsistent with most of rustdoc, which uses default browser styles for the focus outline. Unfortunately, just using the default focus outline here won't work, because it gets applied to the summary itself instead of the pseudo-element "real button."
1 parent bed4ad6 commit 60b5f6d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustdoc/html/static/css/rustdoc.css

+8
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,14 @@ details.rustdoc-toggle > summary:hover::before {
15851585
opacity: 1;
15861586
}
15871587

1588+
details.rustdoc-toggle > summary:focus-visible::before {
1589+
/* The SVG is black, and gets turned white using a filter.
1590+
Do the same with the outline.
1591+
*/
1592+
outline: 1px dotted #000;
1593+
outline-offset: 1px;
1594+
}
1595+
15881596
details.rustdoc-toggle.top-doc > summary,
15891597
details.rustdoc-toggle.top-doc > summary::before,
15901598
details.rustdoc-toggle.non-exhaustive > summary,

0 commit comments

Comments
 (0)