doc: improve accessibility of expandable lists · nodejs/node@33ee464 · GitHub
Skip to content

Commit 33ee464

Browse files
aduh95marco-ippolito
authored andcommitted
doc: improve accessibility of expandable lists
PR-URL: #56749 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Claudio Wunder <cwunder@gnome.org>
1 parent f9d6e35 commit 33ee464

4 files changed

Lines changed: 20 additions & 21 deletions

File tree

doc/api_assets/api.js

Lines changed: 5 additions & 1 deletion

doc/api_assets/style.css

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,34 +182,29 @@ li.picker-header .picker-arrow {
182182
height: .6rem;
183183
border-top: .3rem solid transparent;
184184
border-bottom: .3rem solid transparent;
185-
border-left: .6rem solid var(--color-links);
185+
border-left: .6rem solid currentColor;
186186
border-right: none;
187187
margin: 0 .2rem .05rem 0;
188188
}
189189

190-
li.picker-header a:focus .picker-arrow,
191-
li.picker-header a:active .picker-arrow,
192-
li.picker-header a:hover .picker-arrow {
193-
border-left: .6rem solid var(--white);
194-
}
195-
196-
li.picker-header.expanded a:focus .picker-arrow,
197-
li.picker-header.expanded a:active .picker-arrow,
198-
li.picker-header.expanded a:hover .picker-arrow,
190+
li.picker-header.expanded .picker-arrow,
191+
:root:not(.has-js) li.picker-header:focus-within .picker-arrow,
199192
:root:not(.has-js) li.picker-header:hover .picker-arrow {
200-
border-top: .6rem solid var(--white);
193+
border-top: .6rem solid currentColor;
201194
border-bottom: none;
202195
border-left: .35rem solid transparent;
203196
border-right: .35rem solid transparent;
204197
margin-bottom: 0;
205198
}
206199

207200
li.picker-header.expanded > a,
201+
:root:not(.has-js) li.picker-header:focus-within > a,
208202
:root:not(.has-js) li.picker-header:hover > a {
209203
border-radius: 2px 2px 0 0;
210204
}
211205

212206
li.picker-header.expanded > .picker,
207+
:root:not(.has-js) li.picker-header:focus-within > .picker,
213208
:root:not(.has-js) li.picker-header:hover > .picker {
214209
display: block;
215210
z-index: 1;

doc/template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ <h1>Node.js __VERSION__ documentation</h1>
5959
__GTOC_PICKER__
6060
__ALTDOCS__
6161
<li class="picker-header">
62-
<a href="#">
62+
<a href="#options-picker" aria-controls="options-picker">
6363
<span class="picker-arrow"></span>
6464
Options
6565
</a>
6666

67-
<div class="picker">
68-
<ul>
67+
<div class="picker" tabindex="-1">
68+
<ul id="options-picker">
6969
<li>
7070
<a href="all.html">View on single page</a>
7171
</li>

tools/doc/html.mjs

Lines changed: 6 additions & 6 deletions

0 commit comments

Comments
 (0)