Commit 71ecc96
Use a different CSS class to mark TOC levels as visible (#2163)
Fixes #2156.
The underlying issue was that the CSS class `visible` is targeted by
Bootstrap and results in the following rule:
```
visibility: visible !important;
```
which gets applied to the `ul` elements in the secondary sidebar. This
overrides the `visibility: hidden` rule set on the sidebar container
element, making the links focusable via the tab key.
### How to test
1. On a desktop computer, go to a page in Read The Docs preview build.
This page should have a right sidebar visible — i.e., the in-page table
of contents.
2. Click near the bottom of the article and repeatedly press the tab key
to observe how it moves through the links in the secondary sidebar.
3. Zoom the page, or narrow the width of your screen, until the
secondary sidebar disappears.
4. Again, click near the bottom article before the article footer (which
has two links to the previous and next articles)
5. Press the tab key and watch the focus move to those two previous/next
footer links.
6. Keep pressing the tab key and observe that it does not go through any
of the links in the sidebar. (Before this PR, the tab key would take you
through the links in the sidebar, even though those links were not
visible.)
---------
Co-authored-by: Tania Allard <taniar.allard@gmail.com>1 parent 21a1870 commit 71ecc96
File tree
3 files changed
+4
-4
lines changed- src/pydata_sphinx_theme
- assets/styles/components
- tests
3 files changed
+4
-4
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
| 430 | + | |
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments