Merge pull request #5 from 2kool4idkwhat/main

a11y: add a "skip to main content" link
This commit is contained in:
Caio Lente 2023-09-29 19:49:56 -03:00 committed by GitHub
commit 6f2e7d0c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -145,3 +145,18 @@ h3.blog-filter {
cursor: not-allowed; cursor: not-allowed;
opacity: 0.7; opacity: 0.7;
} }
/* "skip to main content" link */
.skiplink {
position: absolute;
top: 5;
transform: translateY(-600%);
transition: transform 0.5s;
background-color: #121212;
font-size: larger;
padding: 6px;
}
.skiplink:focus {
transform: translateY(0%);
}

View File

@ -36,7 +36,7 @@
<header> <header>
{{- partial "header.html" . -}} {{- partial "header.html" . -}}
</header> </header>
<main> <main id="maincontent">
{{- block "main" . }}{{- end }} {{- block "main" . }}{{- end }}
</main> </main>
<footer> <footer>

View File

@ -1,2 +1,4 @@
<a class="skiplink" href="#maincontent">Skip to Main Content</a>
<a href="{{ relURL .Site.Home.Permalink }}" class="title"><h1>{{ .Site.Title }}</h1></a> <a href="{{ relURL .Site.Home.Permalink }}" class="title"><h1>{{ .Site.Title }}</h1></a>
<nav>{{- partial "nav.html" . -}}</nav> <nav>{{- partial "nav.html" . -}}</nav>