Convert chrome-local color constants to theme-aware accessors

The previous theme refactor only flipped `colors::*` tokens; the
~50 chrome-local `const FOO: u32 = 0xffffff…;` overlays kept their
white-glass values, so dark mode still painted a light omnibar pill,
light search field, light sidebar tab card, light command-overlay
backdrop, light sync page chips, etc.

Promote `colors::pick(light, dark)` to `pub` so component-internal
constants can reach the same thread-local mode the global palette
uses, then convert every white-glass (`0xffffff??`) and warm-dark
wash (`0x281e14??`) constant in:

- chrome/topbar (omnibar pill, hover chip)
- chrome/sidebar_chrome + chrome/sidebar (rail nav row hover/active,
  highlight border, close-button hover, unread badge)
- chrome/sidebar_header (workspace picker, disclosure card)
- chrome/command_overlay + chrome/command_rows + chrome/command_footer
- chrome/settings_layout, chrome/appearance_form,
  chrome/appearance_layout_cards, chrome/plugin_detail_view
- chrome/home/style (search field, arrow chip, pill, card, add-tile)
- internal_pages/sync (status pill, metrics card, button row)
- internal_pages/plugin_catalog
- shell/render (main pane highlight border)

Each constant becomes `fn name() -> u32 { colors::pick(<light>, <dark>) }`
where the dark counterpart preserves the original alpha but swaps the
warm-white prefix `ffffff` for warm-graphite `1f1d1b` (or the inverse:
`281e14` warm-dark wash → `f2efe9` warm-white wash). Brand accents
(`0xc96442??`, `0xffaa7733`) and the global slate backdrop keep their
single value across modes.
This commit is contained in:
2026-05-15 20:22:51 -04:00
parent 467dcb1f87
commit 39d10bf3d7
20 changed files with 227 additions and 121 deletions
+6 -1
View File
@@ -37,8 +37,13 @@ pub fn mode() -> Mode {
CURRENT_MODE.with(Cell::get)
}
/// Pick between a light- and dark-mode value based on the active
/// thread-local mode. Exposed so chrome-local constants that don't
/// belong in the global palette (component-internal translucent
/// glass, backdrops with bespoke alpha curves) can still flip with
/// the rest of the design system.
#[must_use]
fn pick(light: u32, dark: u32) -> u32 {
pub fn pick(light: u32, dark: u32) -> u32 {
match mode() {
Mode::Light => light,
Mode::Dark => dark,