Skip to content

Commit ebfea20

Browse files
authored
Merge pull request #19 from CodeWithGroup/feature/skip-link
feat: adds skip link
2 parents c5ab5da + 5b7cab3 commit ebfea20

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

_layouts/default.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
{% include head.html %}
44

55
<body>
6+
<a class="sr-only sr-only-focusable" href="#page-content">Skip to main content</a>
67
<!-- Google Tag Manager (noscript) -->
78
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WPSF3G7"
89
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
910
<!-- End Google Tag Manager (noscript) -->
1011

1112
<div id="main-container" class="page-wrapper toggled">
1213
{% include sidebar.html %}
13-
<main role="main" class="page-content">
14-
<a name="top"></a>
14+
<main role="main" class="page-content" id="page-content">
1515
<div class="row">
1616
<div class="main-logo">
1717
<a href="index.html"><img src="./images/keyboard-green.png"></a>

css/style.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ a:hover {
4545
font-size: 115%;
4646
}
4747

48+
a.sr-only-focusable[href="#page-content"]:focus {
49+
position: absolute;
50+
left: 50vw;
51+
transform: translateX(-50%);
52+
top: 0.5em;
53+
transition: none;
54+
}
55+
4856
/* Custom default button */
4957
.btn-default,
5058
.btn-default:hover,

0 commit comments

Comments
 (0)