introduce typography system and motion module

This commit is contained in:
2026-10-09 19:54:08 +07:00
parent 41e991dd30
commit df411bd044
53 changed files with 1116 additions and 457 deletions
+6 -6
View File
@@ -3,7 +3,7 @@ use gpui::{
relative,
};
use nip29::{Group, GroupMetadata};
use theme::{ActiveTheme, control_radius};
use theme::{ActiveTheme, TextStyle, Typeset as _, control_radius};
use ui::avatar::Avatar;
use ui::{Sizable, StyledExt, WindowExtension, h_flex, v_flex};
@@ -22,7 +22,7 @@ fn body(group: &WeakEntity<Group>, cx: &App) -> AnyElement {
};
let group = entity.read(cx);
let mut body = v_flex().gap_3().text_sm().child(header(group, cx));
let mut body = v_flex().gap_3().text_style(TextStyle::Callout).child(header(group, cx));
if let Some(metadata) = group.metadata() {
if let Some(about) = metadata.about.as_ref() {
@@ -137,14 +137,14 @@ fn header(group: &Group, cx: &App) -> AnyElement {
.min_w_0()
.child(
div()
.text_base()
.text_style(TextStyle::Body)
.font_semibold()
.truncate()
.child(group.display_name()),
)
.child(
div()
.text_xs()
.text_style(TextStyle::Caption)
.text_color(cx.theme().text_faint)
.truncate()
.child(SharedString::from(format!(
@@ -162,7 +162,7 @@ fn section(label: &'static str, content: AnyElement, cx: &App) -> AnyElement {
.gap_1()
.child(
div()
.text_xs()
.text_style(TextStyle::Caption)
.font_medium()
.text_color(cx.theme().text_muted)
.child(label),
@@ -186,7 +186,7 @@ fn chip(label: impl Into<SharedString>, cx: &App) -> AnyElement {
.rounded(px(control_radius()))
.bg(cx.theme().surface_raised)
.text_color(cx.theme().text)
.text_xs()
.text_style(TextStyle::Caption)
.line_height(relative(1.))
.child(label.into())
.into_any_element()