migrate ui crate to new theme tokens
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use gpui::{App, Div, Pixels, Refineable, StyleRefinement, Styled, div, px};
|
||||
pub use gpui_base::component_traits::{Disableable, Selectable};
|
||||
use theme::ActiveTheme;
|
||||
use theme::{ActiveTheme, surface_radius, surface_shadows};
|
||||
|
||||
/// Returns a `Div` as horizontal flex layout.
|
||||
pub fn h_flex() -> Div {
|
||||
@@ -14,7 +14,7 @@ pub fn v_flex() -> Div {
|
||||
|
||||
/// Returns a `Div` as divider.
|
||||
pub fn divider(cx: &App) -> Div {
|
||||
div().my_1().w_full().h_px().bg(cx.theme().border_variant)
|
||||
div().my_1().w_full().h_px().bg(cx.theme().border_faint)
|
||||
}
|
||||
|
||||
macro_rules! font_weight {
|
||||
@@ -53,11 +53,13 @@ pub trait StyledExt: Styled + Sized {
|
||||
/// Set as Popover style
|
||||
#[inline]
|
||||
fn popover_style(self, cx: &mut App) -> Self {
|
||||
self.bg(cx.theme().background)
|
||||
let shadows = cx.theme().shadow.then(surface_shadows).unwrap_or_default();
|
||||
|
||||
self.bg(cx.theme().surface_overlay)
|
||||
.border_1()
|
||||
.border_color(cx.theme().border)
|
||||
.shadow_md()
|
||||
.rounded(cx.theme().radius_lg)
|
||||
.shadow(shadows)
|
||||
.rounded(px(surface_radius()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user