Unify theme sizing and spacing on Base UI metrics

- Read only mode, accent, accessibility, and native window material from the OS.
- Replace platform palettes, metrics, type ramps, borders, and elevations with unified tokens.
- Align controls, overlays, and data rows with Base UI sizing.
This commit is contained in:
2026-11-16 18:27:44 +07:00
parent 745a01d7af
commit b08516211c
32 changed files with 518 additions and 1761 deletions
+8 -21
View File
@@ -7,7 +7,7 @@ use gpui::{
Window, canvas,
};
use gpui_native_icons::{Icon, IconRole, icon};
use gpui_native_theme::{ActiveTheme as _, BORDER_WIDTH, Size};
use gpui_native_theme::{ActiveTheme as _, Size};
use gpui_native_utils::{focus_handle, focus_ring};
use crate::common::{Sizable, StyledExt, h_flex};
@@ -182,8 +182,6 @@ where
let muted_foreground = theme.colors.muted_foreground;
let radius = theme.radius.control;
let icon_size = metrics.dense_icon_size;
let fields_bordered = theme.borders.fields;
let focus_ring_on = theme.borders.focus_ring;
let label = self
.a11y_label
@@ -209,18 +207,8 @@ where
let is_open = *open.read(cx);
let open_for_items = open.clone();
let (rest_border, hover_border) = if fields_bordered {
(
if is_open && !focus_ring_on {
ring
} else {
border
},
border,
)
} else {
(input, muted)
};
let rest_border = border;
let hover_border = border;
let selected_index = self.selected.as_ref().and_then(|value| {
self.options
@@ -266,10 +254,11 @@ where
})
.cursor_pointer()
.justify_between()
.gap_2()
.gap_3()
.w_full()
.h(metrics.input_height + BORDER_WIDTH * 2.0)
.px(metrics.dense_padding_x)
.h(metrics.input_height)
.pl(metrics.dense_padding_x)
.pr(metrics.plate_inset * 2.0)
.rounded(radius)
.border_1()
.border_color(rest_border)
@@ -280,9 +269,7 @@ where
} else {
muted_foreground
})
.when(is_open && focus_ring_on, |trigger| {
trigger.shadow(focus_ring(ring))
})
.when(is_open, |trigger| trigger.shadow(focus_ring(ring)))
.hover(|style| style.bg(muted).border_color(hover_border))
.child(trigger_text.clone())
.child(