1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// =============================================================================
// SYSTEM THEME DETECTION -- Dark/Light mode detection
// =============================================================================
//
// OS-agnostic theme detection. Checks the CVKG_THEME environment variable first,
// then falls back to dark mode (safe default).
//
// Platform backends may override this with native OS queries (e.g.,
// dark-light crate on desktop, prefers-color-scheme on web).
/// The detected system theme.
/// Detect the current system theme.
///
/// Checks `CVKG_THEME` environment variable first:
/// - `"dark"` → `SystemTheme::Dark`
/// - `"light"` → `SystemTheme::Light`
/// - unset or any other value → `SystemTheme::Dark` (default)
///
/// Platform backends can call this and override with native detection
/// (e.g., `dark-light` crate on desktop, `prefers-color-scheme` on web).