-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rustdoc): open sidebar menu when links inside it are focused #87180
feat(rustdoc): open sidebar menu when links inside it are focused #87180
Conversation
Some changes occurred in HTML/CSS/JS. |
There is a much simpler way to do it. I tested locally with: $ git diff
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 9e3ad667531..8cddd85854a 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1729,7 +1729,7 @@ details.undocumented[open] > summary::before {
width: calc(100% + 30px);
}
- .show-it {
+ .show-it, .sidebar-elems:focus-within {
+ z-index: 2;
left: 0;
} With this, no need for JS. :) The More information on Also, can you add a test in |
5af79dd
to
10d00a3
Compare
@GuillaumeGomez Okay, that's done. |
Fixes rust-lang#87172 Based on rust-lang#87167 (which should be merged first) Preview it at https://notriddle.com/notriddle-rustdoc-test/std/index.html Co-authored-by: Guillaume Gomez <guillaume.gomez@huawei.com>
10d00a3
to
0ea2980
Compare
Awesome, thanks! Just waiting for CI then I r+. |
@bors: r+ |
📌 Commit 0ea2980 has been approved by |
…d-mobile, r=GuillaumeGomez feat(rustdoc): open sidebar menu when links inside it are focused Fixes rust-lang#87172 Based on rust-lang#87167 (which should be merged first) r? `@GuillaumeGomez` Preview it at https://notriddle.com/notriddle-rustdoc-test/std/index.html
…laumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#87107 (Loop over all opaque types instead of looking at just the first one with the same DefId) - rust-lang#87158 (Suggest full enum variant for local modules) - rust-lang#87174 (Stabilize `[T; N]::map()`) - rust-lang#87179 (Mark `const_trait_impl` as active) - rust-lang#87180 (feat(rustdoc): open sidebar menu when links inside it are focused) - rust-lang#87188 (Add GUI test for auto-hide-trait-implementations setting) - rust-lang#87200 (TAIT: Infer all inference variables in opaque type substitutions via InferCx) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #87172
Based on #87167 (which should be merged first)
r? @GuillaumeGomez
Preview it at https://notriddle.com/notriddle-rustdoc-test/std/index.html