Skip to content

Commit 09cbd8e

Browse files
fix(a11y): fix certificate verify page student name contrast in dark mode
secondaryColor defaults to #0f2b1a (dark green) — nearly invisible on the dark #1a1917 background. Inject a scoped <style> block so the brand color applies in light mode (.cert-student-name) while .dark overrides it to the standard legible token (#d4cfc8). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4e6ed53 commit 09cbd8e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/[locale]/verify/[code]/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ export default async function VerificationPage({ params }: PageProps) {
8989

9090
return (
9191
<div className="min-h-screen bg-[#f7f5f2] dark:bg-[#1a1917]">
92+
{!isRevoked && (
93+
<style>{`.cert-student-name { color: ${secondaryColor}; } .dark .cert-student-name { color: #d4cfc8; }`}</style>
94+
)}
9295
{/* Ambient background texture */}
9396
<div
9497
className="fixed inset-0 opacity-[0.015] dark:opacity-[0.03] pointer-events-none"
@@ -118,8 +121,7 @@ export default async function VerificationPage({ params }: PageProps) {
118121
)}
119122

120123
<h1
121-
className="text-4xl sm:text-5xl font-semibold tracking-tight leading-[1.1] mb-3"
122-
style={{ color: isRevoked ? undefined : secondaryColor }}
124+
className={`text-4xl sm:text-5xl font-semibold tracking-tight leading-[1.1] mb-3${isRevoked ? '' : ' cert-student-name'}`}
123125
>
124126
{studentName}
125127
</h1>

0 commit comments

Comments
 (0)