Fix WCAG AA color contrast violations across all pages
Replace incorrect perceived-brightness formula in Stats progress bars with proper WCAG relative luminance calculation, and convert type bar colors to hex values for reliable contrast detection. Add light: variant classes to status badges, yellow/purple text, and admin nav links across 17 files. Darken light-mode status-active token and text-tertiary/muted tokens. Add aria-labels to admin filter selects and flex-wrap for mobile overflow on AdminEvolutions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,12 +43,14 @@ const statusOptions: {
|
||||
{
|
||||
value: 'caught',
|
||||
label: 'Caught',
|
||||
color: 'bg-green-900/40 text-green-300 border-green-700',
|
||||
color:
|
||||
'bg-green-900/40 text-green-300 light:bg-green-100 light:text-green-800 border-green-700 light:border-green-300',
|
||||
},
|
||||
{
|
||||
value: 'fainted',
|
||||
label: 'Fainted',
|
||||
color: 'bg-red-900/40 text-red-300 border-red-700',
|
||||
color:
|
||||
'bg-red-900/40 text-red-300 light:bg-red-100 light:text-red-800 border-red-700 light:border-red-300',
|
||||
},
|
||||
{
|
||||
value: 'missed',
|
||||
@@ -299,7 +301,7 @@ export function EncounterModal({
|
||||
setSelectedPokemon(pickRandomPokemon(routePokemon, dupedPokemonIds))
|
||||
}
|
||||
}}
|
||||
className="px-2.5 py-1 text-xs font-medium rounded-lg border border-purple-600 text-purple-400 hover:bg-purple-900/20 disabled:opacity-40 disabled:cursor-not-allowed transition-colors"
|
||||
className="px-2.5 py-1 text-xs font-medium rounded-lg border border-purple-600 text-purple-400 light:text-purple-700 light:border-purple-500 hover:bg-purple-900/20 light:hover:bg-purple-50 disabled:opacity-40 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
{selectedPokemon ? 'Re-roll' : 'Randomize'}
|
||||
</button>
|
||||
@@ -403,14 +405,14 @@ export function EncounterModal({
|
||||
<EncounterMethodBadge method={rp.encounterMethod} />
|
||||
)}
|
||||
{!isDuped && displayRate !== null && displayRate !== undefined && (
|
||||
<span className="text-[10px] text-purple-400 font-medium">
|
||||
<span className="text-[10px] text-purple-400 light:text-purple-700 font-medium">
|
||||
{displayRate}%
|
||||
</span>
|
||||
)}
|
||||
{!isDuped &&
|
||||
selectedCondition === null &&
|
||||
conditions.length > 0 && (
|
||||
<span className="text-[10px] text-purple-400">
|
||||
<span className="text-[10px] text-purple-400 light:text-purple-700">
|
||||
{conditions.join(', ')}
|
||||
</span>
|
||||
)}
|
||||
@@ -518,7 +520,7 @@ export function EncounterModal({
|
||||
onClick={() => setNickname(name)}
|
||||
className={`px-2.5 py-1 text-xs rounded-full border transition-colors ${
|
||||
nickname === name
|
||||
? 'bg-accent-900/40 border-accent-600 text-accent-300'
|
||||
? 'bg-accent-900/40 border-accent-600 text-accent-300 light:bg-accent-100 light:text-accent-700'
|
||||
: 'border-border-default text-text-secondary hover:border-accent-600 hover:bg-accent-900/20'
|
||||
}`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user