Skip to content
forked from pydata/xarray

Commit d33e4ad

Browse files
authored
Accessibility: Add keyboard handling for XArray HTML view (pydata#9412)
The default html view generated via XArray uses hidden checkboxes to achieve collapse expand behaviour. This PR - Makes the hidden checkboxes visible with 0 opacity , to make them accessible via keyboard Make style changes to associated labels for focus, to highlight where the keyboard focus is Change the grid layout to account for the invisible checkboxes
1 parent 20cde77 commit d33e4ad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

xarray/static/css/style.css

+7-2
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ body.vscode-dark {
6565
.xr-sections {
6666
padding-left: 0 !important;
6767
display: grid;
68-
grid-template-columns: 150px auto auto 1fr 20px 20px;
68+
grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;
6969
}
7070

7171
.xr-section-item {
7272
display: contents;
7373
}
7474

7575
.xr-section-item input {
76-
display: none;
76+
display: inline-block;
77+
opacity: 0;
7778
}
7879

7980
.xr-section-item input + label {
@@ -85,6 +86,10 @@ body.vscode-dark {
8586
color: var(--xr-font-color2);
8687
}
8788

89+
.xr-section-item input:focus + label {
90+
border: 2px solid var(--xr-font-color0);
91+
}
92+
8893
.xr-section-item input:enabled + label:hover {
8994
color: var(--xr-font-color0);
9095
}

0 commit comments

Comments
 (0)