Use shared theme tokens across components

- Replace remaining raw component metrics with theme constants.
- Share disabled opacity, focus ring alpha, and code line height.
- Route editor borders, weights, and links through the theme.
- Align tab, alert, toast, panel, and resize spacing.
This commit is contained in:
2026-11-16 18:35:00 +07:00
parent 9e61147ca9
commit 1dafa87bef
27 changed files with 136 additions and 89 deletions
+5 -2
View File
@@ -4,7 +4,7 @@ use gpui::{
Refineable as _, StatefulInteractiveElement, StyleRefinement, Styled, Window, WindowId, div,
px,
};
use gpui_native_theme::{ActiveTheme as _, FOCUS_RING_SPREAD};
use gpui_native_theme::{ActiveTheme as _, FOCUS_RING_ALPHA, FOCUS_RING_SPREAD};
use std::collections::HashMap;
/// A row whose children center on the cross axis.
@@ -94,7 +94,10 @@ pub fn record_anchor_bounds(
/// Returns a focus ring shadow with the given color at half ink.
pub fn focus_ring(color: Hsla) -> Vec<BoxShadow> {
vec![BoxShadow::new(px(0.), px(0.), color.alpha(0.5)).spread_radius(FOCUS_RING_SPREAD)]
vec![
BoxShadow::new(px(0.), px(0.), color.alpha(FOCUS_RING_ALPHA))
.spread_radius(FOCUS_RING_SPREAD),
]
}
/// The next selectable row in the direction, or `None` at the ends.