Skip to content

Commit 362874d

Browse files
fix(a11y): address Lighthouse audit findings — contrast, touch targets, labels (#123)
Lighthouse scores: Accessibility 92→target 96+, SEO 100, Best Practices 92 Fixes: - Color contrast: "Data syncs weekly" text-gray-400 → text-gray-500 (WCAG AA requires 4.5:1 contrast ratio) - Touch targets: footer links increased from space-y-1 to space-y-2 with py-1 padding for 44px minimum touch target - Accessible names: ThemeToggle aria-label now includes visible text ("Dark mode active, switch to light" contains "Dark") - Footer links: removed redundant aria-labels that mismatched visible text Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ad946ee commit 362874d

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

apps/web/src/components/ThemeToggle.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<button
2525
onclick={toggle}
26-
aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
26+
aria-label={isDark ? 'Dark mode active, switch to light' : 'Light mode active, switch to dark'}
2727
class="inline-flex items-center gap-1.5 rounded border border-gray-300 px-2.5 py-1.5 text-xs font-sans transition-colors hover:bg-gray-200 dark:border-gray-700 dark:hover:bg-gray-800"
2828
>
2929
<span aria-hidden="true">{isDark ? '🌙' : '☀️'}</span>

apps/web/src/layouts/BaseLayout.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,19 @@ const titleEntries = Object.entries(TITLE_NAMES)
134134
</div>
135135
<div>
136136
<h2 class="mb-2 text-xs font-bold uppercase tracking-wide text-gray-700 dark:text-gray-300">Resources</h2>
137-
<ul class="space-y-1 text-xs">
137+
<ul class="space-y-2 text-xs">
138138
<li>
139-
<a href="https://uscode.house.gov/" class="underline hover:text-teal" rel="noopener noreferrer" target="_blank" aria-label="Official U.S. Code (OLRC), opens in new tab">
139+
<a href="https://uscode.house.gov/" class="inline-block py-1 underline hover:text-teal" rel="noopener noreferrer" target="_blank">
140140
Official U.S. Code (OLRC)
141141
</a>
142142
</li>
143143
<li>
144-
<a href="https://github.com/civic-source/us-code" class="underline hover:text-teal" rel="noopener noreferrer" target="_blank" aria-label="Source Data on GitHub, opens in new tab">
144+
<a href="https://github.com/civic-source/us-code" class="inline-block py-1 underline hover:text-teal" rel="noopener noreferrer" target="_blank">
145145
Source Data (GitHub)
146146
</a>
147147
</li>
148148
<li>
149-
<a href="https://github.com/civic-source/us-code-tracker" class="underline hover:text-teal" rel="noopener noreferrer" target="_blank" aria-label="Pipeline Code on GitHub, opens in new tab">
149+
<a href="https://github.com/civic-source/us-code-tracker" class="inline-block py-1 underline hover:text-teal" rel="noopener noreferrer" target="_blank">
150150
Pipeline Code (GitHub)
151151
</a>
152152
</li>

apps/web/src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const base = import.meta.env.BASE_URL;
108108
</div>
109109
)}
110110
</div>
111-
<p class="not-prose mt-2 text-xs text-gray-400 dark:text-gray-600 font-sans">
111+
<p class="not-prose mt-2 text-xs text-gray-500 dark:text-gray-400 font-sans">
112112
Data syncs weekly from the Office of the Law Revision Counsel.
113113
</p>
114114

0 commit comments

Comments
 (0)