Rollup merge of #103554 - notriddle:notriddle/summary-focus-visible, r=jsha
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." Preview: https://notriddle.com/notriddle-rustdoc-demos/focus-outline/test_dingus/fn.test.html ## Screenshots ### light  ### dark  ### ayu 
This commit is contained in:
commit
74a4c679b3
1 changed files with 9 additions and 0 deletions
|
@ -1585,6 +1585,15 @@ details.rustdoc-toggle > summary:hover::before {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
details.rustdoc-toggle > summary:focus-visible::before {
|
||||||
|
/* The SVG is black, and gets turned white using a filter in the dark themes.
|
||||||
|
Do the same with the outline.
|
||||||
|
The dotted 1px style is copied from Firefox's focus ring style.
|
||||||
|
*/
|
||||||
|
outline: 1px dotted #000;
|
||||||
|
outline-offset: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
details.rustdoc-toggle.top-doc > summary,
|
details.rustdoc-toggle.top-doc > summary,
|
||||||
details.rustdoc-toggle.top-doc > summary::before,
|
details.rustdoc-toggle.top-doc > summary::before,
|
||||||
details.rustdoc-toggle.non-exhaustive > summary,
|
details.rustdoc-toggle.non-exhaustive > summary,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue