Skip to content
Open
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-09-08 - Accessible Scrollable Regions and Focus States
**Learning:** Scrollable overflow containers (like tables) require explicit keyboard support (`tabindex="0"`, `role="region"`, `aria-label`) to be accessible. Relying solely on brightness changes for focus states is insufficient for WCAG contrast guidelines.
**Action:** Always add proper ARIA labeling and tabindex to scrollable regions, and use distinct `outline` with `outline-offset` for interactive elements' focus states.
2 changes: 1 addition & 1 deletion site/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const description =

<h2>What is measured</h2>

<div class="scroller">
<div class="scroller" tabindex="0" role="region" aria-label="Performance measurements">
<table>
<thead>
<tr><th>Setting</th><th>Result</th></tr>
Expand Down
23 changes: 21 additions & 2 deletions site/src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ body {
color: var(--accent);
}

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

.theme-toggle {
font: inherit;
font-size: 0.82rem;
Expand All @@ -119,6 +124,11 @@ body {
border-color: var(--accent);
}

.theme-toggle:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}

main {
padding: 2.6rem 0 4rem;
}
Expand Down Expand Up @@ -198,11 +208,15 @@ li {
border: 1px solid var(--rule);
}

.btn:hover,
.btn:focus-visible {
.btn:hover {
filter: brightness(1.08);
}

.btn:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}

.scroller {
overflow-x: auto;
border: 1px solid var(--rule);
Expand All @@ -211,6 +225,11 @@ li {
margin: 0 0 1.1rem;
}

.scroller:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}

table {
border-collapse: collapse;
width: 100%;
Expand Down
Loading