forked from 1b-agent/opencadstudio-upstream
fix(ui): enforce WCAG AA contrast thresholds across UI themes
- Raise accessible_accent default threshold from 2.0 to 3.0 (WCAG 1.4.11 UI state indicators) - Raise EntryKind::Info command line history threshold from 3.0 to 4.5 (WCAG 1.4.3 normal text) - Update themed_check_cell to verify >= 3.0:1 contrast across both weak popup panel and strong highlighted rows - Replace fully-qualified accessible_accent_threshold calls inside closures with use imports - Add comprehensive 9-suite theme accessibility contrast test suite covering all 22 themes across core surfaces
This commit is contained in:
1 parent
23a9884f90
commit
a7e3cf3a6d
6 files changed
+879
-477
No files matched your search
@@ -63,10 +63,10 @@ pub(crate) fn accessible_accent_threshold(
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `accent` if it achieves at least 2.0:1 contrast against `bg`,
|
||||
/// Returns `accent` if it achieves at least 3.0:1 contrast against `bg` (WCAG 1.4.11 for UI components),
|
||||
/// otherwise safely falls back to `fallback`.
|
||||
pub(crate) fn accessible_accent(accent: Color, bg: Color, fallback: Color) -> Color {
|
||||
accessible_accent_threshold(accent, bg, fallback, 2.0)
|
||||
accessible_accent_threshold(accent, bg, fallback, 3.0)
|
||||
}
|
||||
|
||||
/// Returns true if the given canvas background color has a WCAG relative luminance > 0.5 (light surface).
|
||||
|
||||
Reference in new issue
Block a user