Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2024-05-24 - Missing skip-link and focus states
**Learning:** Found that the Astro frontend lacks a "Skip to main content" link for screen reader users and explicit `focus-visible` indicators for keyboard navigation.
**Action:** Always verify if a skip link is present on layout templates and ensure focus indicators are clearly visible across interactive elements.
3 changes: 2 additions & 1 deletion site/src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const base = import.meta.env.BASE_URL;
</script>
</head>
<body>
<a href="#main" class="skip-link">Skip to main content</a>
<header class="site-header">
<div class="wrap">
<a class="brand" href={base}>TACET</a>
Expand All @@ -43,7 +44,7 @@ const base = import.meta.env.BASE_URL;
</div>
</header>

<main class="wrap">
<main id="main" class="wrap" tabindex="-1">
<slot />
</main>

Expand Down
24 changes: 24 additions & 0 deletions site/src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,30 @@ footer.site-footer {
color: var(--muted);
}

.skip-link {
position: absolute;
top: -40px;
left: 0;
background: var(--accent);
color: var(--paper);
padding: 8px;
z-index: 100;
}

.skip-link:focus {
top: 0;
}

main:focus {
outline: none;
}

a:focus-visible,
button:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
* {
animation: none !important;
Expand Down
Loading