Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
[Accessibility] "Collapse panes" buttons should be accessible
Browse files Browse the repository at this point in the history
Enter/Space collapses/expands panes
Buttons are reachable with the keyboard
Buttons have hover/focus styling
  • Loading branch information
Johnny Khalil committed Sep 22, 2017
1 parent b00cbc3 commit 1d43b3c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/components/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
box-sizing: border-box;
}

button {
background: transparent;
outline: none;
border: none;
}

button:hover,button:focus {
background-color: var(--theme-toolbar-background-hover);
}

.debugger {
display: flex;
flex: 1;
Expand Down
10 changes: 5 additions & 5 deletions src/components/shared/Button/PaneToggle.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.toggle-button-start,
.toggle-button-end {
transform: translate(0, 2px);
transform: translate(0, 0px);
transition: transform 0.25s ease-in-out;
padding: 5px 2px;
padding: 5px 5px;
}

.toggle-button-start.vertical,
.toggle-button-end.vertical {
padding: 4px 2px;
padding: 2.5px 2.5px;
}

.toggle-button-start svg,
Expand All @@ -22,12 +22,12 @@
}

.toggle-button-end {
margin-inline-end: 5px;
margin-inline-end: 0px;
margin-inline-start: auto;
}

.toggle-button-start {
margin-inline-start: 5px;
margin-inline-start: 0px;
}

html:not([dir="rtl"]) .toggle-button-end svg,
Expand Down
4 changes: 2 additions & 2 deletions src/components/shared/Button/PaneToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PaneToggleButton extends Component {
: L10N.getStr("collapsePanes");

return (
<div
<button
className={classnames(`toggle-button-${position}`, {
collapsed,
vertical: horizontal != null ? !horizontal : false
Expand All @@ -39,7 +39,7 @@ class PaneToggleButton extends Component {
title={title}
>
<Svg name="togglePanes" />
</div>
</button>
);
}
}
Expand Down

0 comments on commit 1d43b3c

Please sign in to comment.