Skip to content

Commit 16c7244

Browse files
sgammonclaude
andcommitted
fix(a11y): readable API-reference text in light theme
ApiMethod rendered the signature function-name and ParamRow type using the code-surface syntax tokens (--eld-syntax-function pale yellow, --eld-syntax-type teal). Those are tuned for the always-dark code surface and become unreadable on the light page background. Use theme-aware tokens: the signature name -> the --primary-emphasis accent, the param type -> muted-foreground. Clears the remaining light-theme color-contrast violations (Chromatic tests both themes). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 982730f commit 16c7244

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/ui/src/components/api-method.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function ParamRow({ name, type, description, className }: ParamRowProps)
1919
return (
2020
<div className={cn("flex items-baseline gap-3", className)}>
2121
<code className="w-24 shrink-0 font-mono text-[12.5px] text-[var(--primary-emphasis)]">{name}</code>
22-
<span className="shrink-0 font-mono text-xs text-[var(--eld-syntax-type)]">{type}</span>
22+
<span className="shrink-0 font-mono text-xs text-muted-foreground">{type}</span>
2323
{description ? (
2424
<span className="text-[13.5px] text-muted-foreground [&_code]:font-mono [&_code]:text-[var(--primary-emphasis)]">
2525
{description}
@@ -36,7 +36,7 @@ function emphasizeSignature(signature: string | React.ReactNode) {
3636
if (parenIndex === -1) return signature;
3737
return (
3838
<>
39-
<span className="text-[var(--eld-syntax-function)]">{signature.slice(0, parenIndex)}</span>
39+
<span className="text-[var(--primary-emphasis)]">{signature.slice(0, parenIndex)}</span>
4040
{signature.slice(parenIndex)}
4141
</>
4242
);

0 commit comments

Comments
 (0)