From 2ef299caa0949f39aa1db0dc9b5ce2c9cdb9a0ad Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sat, 20 Jun 2026 15:49:37 -0600 Subject: [PATCH] feat(a11y): tokenize Toast icon colors to semantic tokens Replace the hardcoded per-kind icon hex (#4CAF50/#ff6b6b/#FFA726) with Theme.success/danger/warning so the toast tint is themeable; buffering and info keep Theme.accent. The per-kind icon already carries the non-color cue (WCAG 1.4.1) -- this only guarantees contrast in the a11y palettes while staying visually neutral in the 31 standard themes. cc --- crates/qbz-slint/ui/primitives/Toast.slint | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/qbz-slint/ui/primitives/Toast.slint b/crates/qbz-slint/ui/primitives/Toast.slint index 87a6b0915..90db46639 100644 --- a/crates/qbz-slint/ui/primitives/Toast.slint +++ b/crates/qbz-slint/ui/primitives/Toast.slint @@ -28,11 +28,14 @@ export component Toast inherits Rectangle { : root.kind == ToastKind.buffering ? @image-url("../assets/icons/loader-circle.svg") : @image-url("../assets/icons/info.svg"); - // Per-kind accent, matching Tauri's colors. + // Per-kind accent, themed via the semantic tokens. The per-kind icon + // (success check / error alert / warning triangle) already carries the + // non-color cue for WCAG 1.4.1; this just makes the tint themeable so it + // stays high-contrast in the a11y palettes. buffering/info keep accent. property icon-color: - root.kind == ToastKind.success ? #4CAF50 - : root.kind == ToastKind.error ? #ff6b6b - : root.kind == ToastKind.warning ? #FFA726 + root.kind == ToastKind.success ? Theme.success + : root.kind == ToastKind.error ? Theme.danger + : root.kind == ToastKind.warning ? Theme.warning : Theme.accent; toast := Rectangle {