Skip to content

Commit 1c6e5a5

Browse files
committed
Handle keyboard focus properly in on dropdowns + checkboxes
Resolves #2556
1 parent 56f92c5 commit 1c6e5a5

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
- Links added with the `navigationLinks` option are now moved into the pull out navigation on mobile displays, #2548.
5353
- `@license` and `@import` comments will be ignored at the top of files, #2552.
5454
- Fixed issue in documentation validation where constructor signatures where improperly considered not documented, #2553.
55+
- Keyboard focus is now visible on dropdowns and checkboxes in the default theme, #2556.
5556
- The color theme label in the default theme now has an accessible name, #2557.
5657
- Fixed issue where search results could not be navigated while Windows Narrator was on, #2563.
5758
- `charset` is now correctly cased in `<meta>` tag generated by the default theme, #2568.

static/style.css

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
--light-color-text: #222;
1111
--light-color-text-aside: #6e6e6e;
1212
--light-color-link: #1f70c2;
13+
--light-color-focus-outline: #3584e4;
1314

1415
--light-color-ts-keyword: #056bd6;
1516
--light-color-ts-project: #b111c9;
@@ -51,6 +52,7 @@
5152
--dark-color-text: #f5f5f5;
5253
--dark-color-text-aside: #dddddd;
5354
--dark-color-link: #00aff4;
55+
--dark-color-focus-outline: #4c97f2;
5456

5557
--dark-color-ts-keyword: #3399ff;
5658
--dark-color-ts-project: #e358ff;
@@ -94,6 +96,7 @@
9496
--color-text: var(--light-color-text);
9597
--color-text-aside: var(--light-color-text-aside);
9698
--color-link: var(--light-color-link);
99+
--color-focus-outline: var(--light-color-focus-outline);
97100

98101
--color-ts-keyword: var(--light-color-ts-keyword);
99102
--color-ts-module: var(--light-color-ts-module);
@@ -137,6 +140,7 @@
137140
--color-text: var(--dark-color-text);
138141
--color-text-aside: var(--dark-color-text-aside);
139142
--color-link: var(--dark-color-link);
143+
--color-focus-outline: var(--dark-color-focus-outline);
140144

141145
--color-ts-keyword: var(--dark-color-ts-keyword);
142146
--color-ts-module: var(--dark-color-ts-module);
@@ -187,6 +191,7 @@ body {
187191
--color-text: var(--light-color-text);
188192
--color-text-aside: var(--light-color-text-aside);
189193
--color-link: var(--light-color-link);
194+
--color-focus-outline: var(--light-color-focus-outline);
190195

191196
--color-ts-keyword: var(--light-color-ts-keyword);
192197
--color-ts-module: var(--light-color-ts-module);
@@ -228,6 +233,7 @@ body {
228233
--color-text: var(--dark-color-text);
229234
--color-text-aside: var(--dark-color-text-aside);
230235
--color-link: var(--dark-color-link);
236+
--color-focus-outline: var(--dark-color-focus-outline);
231237

232238
--color-ts-keyword: var(--dark-color-ts-keyword);
233239
--color-ts-module: var(--dark-color-ts-module);
@@ -258,6 +264,11 @@ body {
258264
--color-scheme: var(--dark-color-scheme);
259265
}
260266

267+
*:focus-visible,
268+
.tsd-accordion-summary:focus-visible svg {
269+
outline: 2px solid var(--color-focus-outline);
270+
}
271+
261272
.always-visible,
262273
.always-visible .tsd-signatures {
263274
display: inherit !important;
@@ -604,11 +615,8 @@ dl.tsd-comment-tag-group p {
604615
Don't remove unless you know what you're doing. */
605616
opacity: 0.99;
606617
}
607-
.tsd-filter-input input[type="checkbox"]:focus + svg {
608-
transform: scale(0.95);
609-
}
610-
.tsd-filter-input input[type="checkbox"]:focus:not(:focus-visible) + svg {
611-
transform: scale(1);
618+
.tsd-filter-input input[type="checkbox"]:focus-visible + svg {
619+
outline: 2px solid var(--color-focus-outline);
612620
}
613621
.tsd-checkbox-background {
614622
fill: var(--color-accent);

0 commit comments

Comments
 (0)