Skip to content

Commit

Permalink
Merge pull request #309 from orangemug/feature/skip-menu
Browse files Browse the repository at this point in the history
Added skip-menu link for keyboard users
  • Loading branch information
orangemug committed May 28, 2018
2 parents 54c7944 + 272f662 commit 0f103c3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/Toolbar.jsx
Expand Up @@ -135,9 +135,13 @@ export default class Toolbar extends React.Component {
/>
<div className="maputnik-toolbar__inner">
<ToolbarLink
tabIndex="2"
href={"https://github.com/maputnik/editor"}
className="maputnik-toolbar-logo"
>
<a tabIndex="1" className="maputnik-toolbar-skip" href="#skip-menu">
Skip navigation
</a>
<img src={logoImage} alt="Maputnik" />
<h1>Maputnik
<span className="maputnik-toolbar-version">v{pkgJson.version}</span>
Expand Down
1 change: 1 addition & 0 deletions src/components/layers/LayerList.jsx
Expand Up @@ -209,6 +209,7 @@ class LayerListContainer extends React.Component {
<div className="maputnik-default-property">
<div className="maputnik-multibutton">
<button
id="skip-menu"
onClick={this.toggleLayers.bind(this)}
className="maputnik-button">
{this.state.areAllGroupsExpanded === true ? "Collapse" : "Expand"}
Expand Down
22 changes: 22 additions & 0 deletions src/styles/_toolbar.scss
Expand Up @@ -16,6 +16,8 @@
background-color: $color-black;
padding: $margin-2;
height: $toolbar-height;
position: relative;
overflow: hidden;

h1 {
display: inline;
Expand Down Expand Up @@ -80,3 +82,23 @@
flex: 1;
overflow-y: auto;
}

.maputnik-toolbar-skip {
position: absolute;
overflow: hidden;
width: 0px;
height: 100%;
text-align: center;
display: block;
background-color: $color-black;
z-index: 999;
line-height: 40px;
left: 0;
top: 0;

&:active,
&:focus {
width: 100%;
}
}

0 comments on commit 0f103c3

Please sign in to comment.