Make every shell color token theme-aware

Dark mode was persistent in `AppearanceSettings` but never reached any
paint code: every call site in the shell read `colors::INK` etc. as a
`pub const u32`, so toggling `ThemeMode::Dark` mutated state nothing
sampled. Root-cause fix is to invert the contract — the design-system
exports functions that resolve through a thread-local `Mode`, and the
GPUI render impl sets that mode each frame.

What lands:
- `ely_design_system::colors::Mode` + thread-local + `set_mode` /
  `mode` accessors. Every ink shade, glass surface, stroke, divider,
  hairline, canvas, success / error chip now picks the warm-dark
  counterpart when the active mode is `Mode::Dark`.
- `ElyShell::render` resolves `ThemeMode::System` against
  `Window::appearance()` and pushes the mode before traversing the
  tree, so widgets lower down read the right shade without owning a
  `Mode` parameter.
- `render_wallpaper` + `panel_bg` now branch on `colors::mode()` so
  the gradient base, panel tint, and overlay highlights flip to
  warm-graphite when dark mode is active.
- Mechanical conversion across 687 call sites in 55 files from
  `colors::FOO` constants to `colors::foo()` accessors. The
  `Theme` / `ELY_THEME` const surface (unused outside the design
  system) is removed; the function surface is the new contract.
This commit is contained in:
2026-05-15 19:50:38 -04:00
parent 5548427df3
commit 6b2578c3a8
58 changed files with 1010 additions and 745 deletions
-27
View File
@@ -2,30 +2,3 @@ pub mod colors;
pub mod motion;
pub mod spacing;
pub mod typography;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Theme {
pub canvas: u32,
pub canvas_soft: u32,
pub surface: u32,
pub ink: u32,
pub body: u32,
pub muted: u32,
pub hairline: u32,
pub accent: u32,
pub success: u32,
pub error: u32,
}
pub const ELY_THEME: Theme = Theme {
canvas: colors::CANVAS,
canvas_soft: colors::CANVAS_SOFT,
surface: colors::SURFACE_CARD,
ink: colors::INK,
body: colors::INK_2,
muted: colors::INK_3,
hairline: colors::HAIRLINE,
accent: colors::ACCENT,
success: colors::SUCCESS,
error: colors::ERROR,
};