Add Shape enum to avatar component, refactor UITextSize to styles/typography.rs
This commit is contained in:
parent
205607a9cd
commit
56d45e72cd
4 changed files with 36 additions and 140 deletions
27
crates/ui2/src/styles/typography.rs
Normal file
27
crates/ui2/src/styles/typography.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
use gpui::{rems, Rems};
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub enum UITextSize {
|
||||
/// The default size for UI text.
|
||||
///
|
||||
/// `0.825rem` or `14px` at the default scale of `1rem` = `16px`.
|
||||
///
|
||||
/// Note: The absolute size of this text will change based on a user's `ui_scale` setting.
|
||||
#[default]
|
||||
Default,
|
||||
/// The small size for UI text.
|
||||
///
|
||||
/// `0.75rem` or `12px` at the default scale of `1rem` = `16px`.
|
||||
///
|
||||
/// Note: The absolute size of this text will change based on a user's `ui_scale` setting.
|
||||
Small,
|
||||
}
|
||||
|
||||
impl UITextSize {
|
||||
pub fn rems(self) -> Rems {
|
||||
match self {
|
||||
Self::Default => rems(0.875),
|
||||
Self::Small => rems(0.75),
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue