core: use typography roles for text styling
This commit is contained in:
@@ -7,7 +7,7 @@ use gpui::{
|
||||
StatefulInteractiveElement as _, Styled as _, Window, deferred, div, ease_out_quint,
|
||||
};
|
||||
use gpui_native_icons::{Icon, IconRole, icon};
|
||||
use gpui_native_theme::{ActiveTheme as _, ENTER_SLIDE_DISTANCE, Size};
|
||||
use gpui_native_theme::{ActiveTheme as _, ENTER_SLIDE_DISTANCE, Size, TextRole, Typeset as _};
|
||||
use gpui_native_utils::ResultLogErr as _;
|
||||
|
||||
use crate::button::{Button, ButtonVariant};
|
||||
@@ -144,7 +144,6 @@ impl RenderOnce for Alert {
|
||||
let shadows = theme.elevations.popover.shadows();
|
||||
let metrics = theme.sizes.resolve(Size::Medium);
|
||||
let icon_size = metrics.icon_size;
|
||||
let title_size = metrics.text_size;
|
||||
let caption_size = metrics.caption_size;
|
||||
|
||||
div()
|
||||
@@ -178,11 +177,8 @@ impl RenderOnce for Alert {
|
||||
.when_some(self.title.clone(), |alert, title| {
|
||||
alert.child(
|
||||
div()
|
||||
.text_size(title_size)
|
||||
.typeset(TextRole::Headline, cx)
|
||||
.text_color(foreground)
|
||||
.when(self.message.is_some(), |title| {
|
||||
title.font_weight(gpui::FontWeight::SEMIBOLD)
|
||||
})
|
||||
.child(title),
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user