-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a skip link pattern so keyboard users can tab to content, search results, the footer, etc. more efficiently. Closes #123.
- Loading branch information
Showing
9 changed files
with
67 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ul.skip.list-reset | ||
li | ||
a.button-sm.button-secondary(href='#content') Skip to Main Content | ||
li | ||
a.button-sm.button-secondary(href='#footer') Skip to Footer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.skip { | ||
a { | ||
@extend %visually-hidden; | ||
@extend %focusable; | ||
|
||
min-width: 0; | ||
text-transform: none; | ||
opacity: 0; | ||
transition: opacity 100ms; | ||
|
||
&:focus, | ||
&:active { | ||
// Don't forget to add top/left positioning properties for your use case! | ||
position: absolute; | ||
padding: 0.125rem; | ||
opacity: 1; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
extends /_layout.pug | ||
|
||
block vars | ||
- var title = 'Accessibility' | ||
|
||
block content | ||
article.grid-article | ||
h1 Accessibility | ||
| Rocketbelt strives to be accessible out of the box. | ||
|
||
h2 Skip Links | ||
| Main content or items in a page's footer may require dozens or hundreds Tab presses to interact with if a user is navigating via keyboard. Skip links make this interaction much less tedious by using an on-page href. The link is visually hidden unless it is focused via keyboard. | ||
|
||
+exampleCodeOnly | ||
include _a11y-skip-links.pug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.skip { | ||
a { | ||
&:focus, | ||
&:active { | ||
top: 0.5rem; | ||
left: 12rem; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
@import 'vendor/vendor', | ||
'../../rocketbelt/tools/tools', | ||
'a11y', | ||
'color', | ||
'grid', | ||
'icons', | ||
|