Skip to content

Commit 3335334

Browse files
prudhvikrishnagopherbot
prudhvikrishna
authored andcommitted
_content: provide skiplink to go website
added skiplink to skip over the navigation and header elements of the page and go directly to the main content. https://screencast.googleplex.com/cast/NjUzMzAxNTk2MzQzNTAwOHxmYjc5NGE4OS1iMQ Change-Id: I58271abacfcd80a2e996e83c6ad7611711989e92 Reviewed-on: https://go-review.googlesource.com/c/website/+/508975 Auto-Submit: Jamal Carvalho <[email protected]> Reviewed-by: Jamal Carvalho <[email protected]> Run-TryBot: Jamal Carvalho <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 647c4b2 commit 3335334

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

_content/css/styles.css

+15
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,21 @@ a.Footer-link--primary {
563563
.Header-navOpen--white {
564564
background: no-repeat center/2rem url('/images/menu-24px-white.svg');
565565
}
566+
.skip-to-content-link {
567+
background: var(--color-background);
568+
border-radius: 6px;
569+
color: var(--color-text);
570+
font-weight: 500;
571+
margin: 5px;
572+
position: absolute;
573+
overflow: hidden;
574+
top: 12px;
575+
clip: rect(0 0 0 0);
576+
left: 8%;
577+
}
578+
.skip-to-content-link:focus {
579+
clip: unset;
580+
}
566581
.NavigationDrawer {
567582
background: var(--color-background);
568583
height: 100%;

_content/site.tmpl

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
src="/images/go-logo-white.svg"
6161
alt="Go">
6262
</a>
63+
<div class="skip-navigation-wrapper">
64+
<a class="skip-to-content-link" aria-label="Skip to main content" href="#main-content"> Skip to Main Content </a>
65+
</div>
6366
<div class="Header-rightContent">
6467
<ul class="Header-menu">
6568
{{- $currentPage := .}}
@@ -173,7 +176,7 @@
173176
</nav>
174177
</aside>
175178
<div class="NavigationDrawer-scrim js-scrim" role="presentation"></div>
176-
<main class="SiteContent SiteContent--default">
179+
<main class="SiteContent SiteContent--default" id="main-content">
177180
{{block "layout" .}}{{.Content}}{{end}}
178181
</main>
179182
<footer class="Site-footer">

0 commit comments

Comments
 (0)