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:
@@ -45,7 +45,7 @@ fn render_overlay(
|
||||
div()
|
||||
.absolute()
|
||||
.inset_0()
|
||||
.bg(rgba(BACKDROP_BG))
|
||||
.bg(rgba(backdrop_bg()))
|
||||
.flex()
|
||||
.flex_col()
|
||||
.items_center()
|
||||
@@ -67,9 +67,9 @@ fn render_panel(
|
||||
div()
|
||||
.w(px(640.0))
|
||||
.rounded(px(16.0))
|
||||
.bg(rgba(PANEL_BG))
|
||||
.bg(rgba(panel_bg()))
|
||||
.border_1()
|
||||
.border_color(rgba(PANEL_BORDER))
|
||||
.border_color(rgba(panel_border()))
|
||||
.shadow(panel_shadow())
|
||||
.overflow_hidden()
|
||||
.flex()
|
||||
@@ -111,7 +111,7 @@ fn render_header(query_label: String, is_empty: bool) -> AnyElement {
|
||||
.px(px(8.0))
|
||||
.py(px(2.0))
|
||||
.rounded(px(6.0))
|
||||
.bg(rgba(BADGE_BG))
|
||||
.bg(rgba(badge_bg()))
|
||||
.text_size(px(10.5))
|
||||
.text_color(rgb(colors::ink_3()))
|
||||
.child("Switcher"),
|
||||
@@ -199,10 +199,18 @@ fn render_empty_state() -> AnyElement {
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
const PANEL_BG: u32 = 0xfffffff5;
|
||||
const PANEL_BORDER: u32 = 0xffffff80;
|
||||
const BACKDROP_BG: u32 = 0x140f0a3d;
|
||||
const BADGE_BG: u32 = 0x281e140f;
|
||||
fn panel_bg() -> u32 {
|
||||
colors::pick(0xfffffff5, 0x1f1d1bf5)
|
||||
}
|
||||
fn panel_border() -> u32 {
|
||||
colors::pick(0xffffff80, 0x1f1d1b80)
|
||||
}
|
||||
fn backdrop_bg() -> u32 {
|
||||
colors::pick(0x140f0a3d, 0x0d0c0a3d)
|
||||
}
|
||||
fn badge_bg() -> u32 {
|
||||
colors::pick(0x281e140f, 0xf2efe90f)
|
||||
}
|
||||
|
||||
fn panel_shadow() -> Vec<BoxShadow> {
|
||||
vec![BoxShadow {
|
||||
|
||||
Reference in New Issue
Block a user