zen_rs/components/text/
h.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Components with fixed size
//! [Tailwindcss font size](https://tailwindcss.com/docs/font-size)

macro_rules! h {
    ($name:tt, $font_size:expr) => {
        paste::paste! {
            #[doc = stringify!(text with $fint_size px size and dark color font)]
            pub fn [<text_$name>](content: impl ToString) -> crate::components::Text {
                crate::components::text()
                    .content(content)
                    .size($font_size)
                    .foreground_color((0, 0, 0, 100))
            }
        }
        paste::paste! {
            #[doc = stringify!(mono text with $fint_size px size and dark color font)]
            pub fn [<mono_text_$name>](content: impl ToString) -> crate::components::Text {
                crate::components::text()
                    .content(content)
                    .size($font_size)
                    .foreground_color((0, 0, 0, 100))
                    .font_default(crate::aspects::DefaultFontFamily::Monospace)
            }
        }
    };
}

h!(9xl, 128);
h!(8xl, 96);
h!(7xl, 72);
h!(6xl, 60);
h!(5xl, 48);
h!(4xl, 36);
h!(3xl, 30);
h!(2xl, 24);
h!(xl, 20);
h!(lg, 18);
h!(base, 16);
h!(sm, 14);
h!(xs, 12);