polished_css/property/typography/text/
mod.rs

1pub mod decoration;
2
3pub use decoration::*;
4
5crate::create_property!(
6    TextAlign,
7    display = "",
8    atomic = "txt-a",
9    custom = false,
10    data_type = "",
11    initial_value = Start,
12    keywords = "start,justify,end,left,right,center,match-parent,justify-all",
13);
14
15crate::create_property!(
16    TextAlignLast,
17    display = "",
18    atomic = "txt-a-l",
19    custom = false,
20    data_type = "",
21    initial_value = Auto,
22    keywords = "auto,start,justify,end,left,right,center,match-parent",
23);
24
25crate::create_property!(
26    TextColor,
27    display = "color",
28    atomic = "txt-c",
29    custom = false,
30    data_type = "<color>",
31    initial_value = CurrentColor,
32    keywords = "currentColor",
33);
34
35crate::create_property!(
36    TextShadowAlpha,
37    display = "",
38    atomic = "txt-sh-a",
39    custom = true,
40    data_type = "<alpha>",
41    initial_value = Initial,
42    keywords = "",
43);
44
45crate::create_property!(
46    TextShadowColor,
47    display = "",
48    atomic = "txt-sh-c",
49    custom = true,
50    data_type = "<color>",
51    initial_value = CurrentColor,
52    keywords = "currentColor",
53);
54
55crate::create_property!(
56    TextTransform,
57    display = "",
58    atomic = "txt-t",
59    custom = false,
60    data_type = "",
61    initial_value = None,
62    keywords = "capitalize,lowercase,uppercase,full-width,full-size-kana,none",
63);
64
65#[cfg(test)]
66mod test {
67    #[test]
68    fn text_align() {
69        let name = "text-align";
70        crate::test_property_initial_value!(TextAlign, Start);
71        crate::test_global_keywords!(TextAlign, name);
72        crate::test_function_var!(TextAlign, name);
73        #[cfg(feature = "atomic")]
74        crate::test_atomic_property!(TextAlign, "txt-a");
75    }
76
77    #[test]
78    fn text_color() {
79        let name = "color";
80        crate::test_property_initial_value!(TextColor, CurrentColor);
81        crate::test_global_keywords!(TextColor, name);
82        crate::test_function_var!(TextColor, name);
83        #[cfg(feature = "atomic")]
84        crate::test_atomic_property!(TextColor, "txt-c");
85    }
86
87    #[test]
88    fn text_shadow_color() {
89        let name = "--text-shadow-color";
90        crate::test_property_initial_value!(TextShadowColor, CurrentColor);
91        crate::test_global_keywords!(TextShadowColor, name);
92        crate::test_function_var!(TextShadowColor, name);
93        #[cfg(feature = "atomic")]
94        crate::test_atomic_property!(TextShadowColor, "txt-sh-c");
95    }
96
97    #[test]
98    fn text_shadow_opacity() {
99        let name = "--text-shadow-alpha";
100        crate::test_property_initial_value!(TextShadowAlpha, Initial);
101        crate::test_global_keywords!(TextShadowAlpha, name);
102        crate::test_function_var!(TextShadowAlpha, name);
103        #[cfg(feature = "atomic")]
104        crate::test_atomic_property!(TextShadowAlpha, "txt-sh-a");
105    }
106
107    #[test]
108    fn text_transform() {
109        let name = "text-transform";
110        crate::test_property_initial_value!(TextTransform, None);
111        crate::test_global_keywords!(TextTransform, name);
112        crate::test_function_var!(TextTransform, name);
113        #[cfg(feature = "atomic")]
114        crate::test_atomic_property!(TextTransform, "txt-t");
115    }
116}