typography.rs

 1use gpui::{rems, Rems};
 2
 3#[derive(Debug, Default, Clone)]
 4pub enum UITextSize {
 5    /// The default size for UI text.
 6    ///
 7    /// `0.825rem` or `14px` at the default scale of `1rem` = `16px`.
 8    ///
 9    /// Note: The absolute size of this text will change based on a user's `ui_scale` setting.
10    #[default]
11    Default,
12    /// The small size for UI text.
13    ///
14    /// `0.75rem` or `12px` at the default scale of `1rem` = `16px`.
15    ///
16    /// Note: The absolute size of this text will change based on a user's `ui_scale` setting.
17    Small,
18}
19
20impl UITextSize {
21    pub fn rems(self) -> Rems {
22        match self {
23            Self::Default => rems(0.875),
24            Self::Small => rems(0.75),
25        }
26    }
27}