Skip to content

Commit 31b0ea4

Browse files
Ajit Pratap Singhclaude
authored andcommitted
fix(website): fix Lighthouse a11y failures — code contrast + select label
Two specific Lighthouse accessibility failures from the CI report: 1. color-contrast (2.17:1): The <code> inside MiniPlayground's output <pre> had text-zinc-300 which got overridden to dark gray (#4B5563) by the global light mode CSS, but the <pre> bg stays dark (#1E1E2E). Fix: use inline style={{ color: '#D4D4D8' }} on all code-block <pre> and <textarea> elements so the color can't be overridden. 2. select-name: The dialect <select> was wrapped in a <label> with no visible text. Lighthouse couldn't associate them. Fix: add explicit <label> with "Dialect:" text + aria-label on select. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3437c12 commit 31b0ea4

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

website/src/components/home/MiniPlayground.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,26 +131,29 @@ export function MiniPlayground() {
131131
<span className="w-2.5 h-2.5 rounded-full bg-green-500/60" />
132132
</div>
133133
<span className="text-xs text-zinc-300 font-mono ml-2">query.sql</span>
134-
<label htmlFor="mini-dialect" className="ml-auto flex items-center gap-1.5">
134+
<div className="ml-auto flex items-center gap-1.5">
135+
<label htmlFor="mini-dialect" className="text-xs text-zinc-300 font-mono">Dialect:</label>
135136
<select
136137
id="mini-dialect"
137138
value={dialect}
138139
onChange={(e) => setDialect(e.target.value)}
140+
aria-label="SQL dialect"
139141
className="bg-zinc-800/80 text-zinc-300 text-xs rounded px-1.5 py-0.5 border border-white/[0.06] focus:outline-none focus:border-indigo-500/50 appearance-none cursor-pointer"
140142
>
141143
{DIALECTS.map((d) => (
142144
<option key={d.value} value={d.value}>{d.label}</option>
143145
))}
144146
</select>
145-
</label>
147+
</div>
146148
</div>
147149
<div className="relative">
148150
<textarea
149151
value={sql}
150152
onChange={handleSqlChange}
151153
spellCheck={false}
152154
aria-label="SQL query input"
153-
className="w-full p-4 text-[14px] leading-relaxed font-mono text-zinc-300 bg-transparent resize-none max-h-[320px] min-h-[200px] focus:outline-none focus:ring-2 focus:ring-accent-indigo/50 overflow-auto"
155+
className="w-full p-4 text-[14px] leading-relaxed font-mono bg-transparent resize-none max-h-[320px] min-h-[200px] focus:outline-none focus:ring-2 focus:ring-accent-indigo/50 overflow-auto"
156+
style={{ color: '#D4D4D8' }}
154157
rows={12}
155158
/>
156159
<div
@@ -196,11 +199,11 @@ export function MiniPlayground() {
196199
className="flex-1 overflow-auto max-h-[320px]"
197200
>
198201
{parseError ? (
199-
<pre className="p-4 text-[14px] leading-relaxed font-mono text-red-400 whitespace-pre-wrap">
202+
<pre className="p-4 text-[14px] leading-relaxed font-mono whitespace-pre-wrap" style={{ color: '#F87171' }}>
200203
{parseError}
201204
</pre>
202205
) : (
203-
<pre className="p-4 text-[14px] leading-relaxed font-mono text-zinc-300 whitespace-pre-wrap">
206+
<pre className="p-4 text-[14px] leading-relaxed font-mono whitespace-pre-wrap" style={{ color: '#D4D4D8' }}>
204207
<code>{output || (loading ? SAMPLE_AST_PLACEHOLDER : '')}</code>
205208
</pre>
206209
)}

0 commit comments

Comments
 (0)