feat: add skip to content link

This commit is contained in:
Devin Haska 2024-03-09 17:09:32 -08:00
parent 0f47b5fda7
commit 9adfd1e2de
3 changed files with 19 additions and 1 deletions

View file

@ -24,7 +24,7 @@
</head>
<body class="[ flex-col ]">
{% include "partials/header.html" %}
<main id="main" class="[ flow flex-1 wrapper ]">
<main id="main" class="[ flow flex-1 wrapper ]" tabindex="-1">
{{ content | safe }}
</main>
{% include "partials/footer.html" %}

View file

@ -1,4 +1,5 @@
<header class="[ navbar ][ py-1 mb-2 ]">
<a href="#main">Skip to content</a>
<div class="[ wrapper ]">
<nav class="[ repel ]">
<div class="[ site-logo ] [ flex items-center gap-0.5 ]">

View file

@ -167,6 +167,23 @@ mark {
padding-block: var(--spacing-0\.25);
}
[href="#main"] {
background-color: var(--color-background);
margin-inline: var(--spacing-1);
}
[href="#main"]:not(:focus) {
border: 0;
clip: rect(0 0 0 0);
height: 0;
margin: 0;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
html:focus-within {
scroll-behavior: auto;