Auto-compute contrast text color for accent backgrounds

Add --primary-contrast CSS variable that auto-switches between white and
dark text based on accent color luminance (WCAG relative luminance).
Replace all hardcoded #fff/white on primary-color backgrounds with
var(--primary-contrast) so light accent colors like yellow remain readable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 16:22:45 +03:00
parent 46a2ebf61e
commit 2bca119ad4
9 changed files with 23 additions and 11 deletions

View File

@@ -7,6 +7,7 @@
:root {
--primary-color: #4CAF50;
--primary-hover: #5cb860;
--primary-contrast: #ffffff;
--danger-color: #f44336;
--warning-color: #ff9800;
--info-color: #2196F3;