mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
feat(rustdoc): open sidebar menu when links inside it are focused
Fixes #87172 Based on #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>
This commit is contained in:
parent
868ffd03ed
commit
0ea2980ae5
@ -1729,7 +1729,8 @@ details.undocumented[open] > summary::before {
|
|||||||
width: calc(100% + 30px);
|
width: calc(100% + 30px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.show-it {
|
.show-it, .sidebar-elems:focus-within {
|
||||||
|
z-index: 2;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,3 +8,13 @@ assert-css: (".sidebar-elems", {"display": "block", "left": "-246px"})
|
|||||||
// Opening the sidebar menu.
|
// Opening the sidebar menu.
|
||||||
click: ".sidebar-menu"
|
click: ".sidebar-menu"
|
||||||
assert-css: (".sidebar-elems", {"display": "block", "left": "0px"})
|
assert-css: (".sidebar-elems", {"display": "block", "left": "0px"})
|
||||||
|
// Closing the sidebar menu.
|
||||||
|
click: ".sidebar-menu"
|
||||||
|
assert-css: (".sidebar-elems", {"display": "block", "left": "-246px"})
|
||||||
|
// Force the sidebar open by focusing a link inside it.
|
||||||
|
// This makes it easier for keyboard users to get to it.
|
||||||
|
focus: ".sidebar-title"
|
||||||
|
assert-css: (".sidebar-elems", {"display": "block", "left": "0px"})
|
||||||
|
// When we tab out of the sidebar, close it.
|
||||||
|
focus: ".search-input"
|
||||||
|
assert-css: (".sidebar-elems", {"display": "block", "left": "-246px"})
|
||||||
|
Loading…
Reference in New Issue
Block a user