about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-10-25 16:52:50 -0700
committerMichael Howell <michael@notriddle.com>2022-10-25 16:52:50 -0700
commit60b5f6dc9190c1fa10c2ca22d472d32f9689253e (patch)
tree4ef572cd80f6ae2ba3ad87c182451719d48f0713
parentbed4ad65bf7a1cef39e3d66b3670189581b3b073 (diff)
downloadrust-60b5f6dc9190c1fa10c2ca22d472d32f9689253e.tar.gz
rust-60b5f6dc9190c1fa10c2ca22d472d32f9689253e.zip
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."
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 173553ed477..84a1fa2e28e 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1585,6 +1585,14 @@ details.rustdoc-toggle > summary:hover::before {
 	opacity: 1;
 }
 
+details.rustdoc-toggle > summary:focus-visible::before {
+	/* The SVG is black, and gets turned white using a filter.
+	   Do the same with the outline.
+	*/
+	outline: 1px dotted #000;
+	outline-offset: 1px;
+}
+
 details.rustdoc-toggle.top-doc > summary,
 details.rustdoc-toggle.top-doc > summary::before,
 details.rustdoc-toggle.non-exhaustive > summary,