polished_css/property/layout/placement/
place.rs

1// TODO: Needs rethinking how to handle the tuple case.
2// Idea: Probably with a trait to make it easier?
3
4crate::create_property!(
5    PlaceContent,
6    display = "",
7    atomic = "place-c",
8    custom = false,
9    data_type = "",
10    initial_value = Normal,
11    keywords = "normal,first,last,baseline,safe,unsafe,center,start,end,self-start,self-end,\
12                flex-start,flex-end",
13);
14
15crate::create_property!(
16    PlaceItems,
17    display = "",
18    atomic = "place-i",
19    custom = false,
20    data_type = "",
21    initial_value = Normal,
22    keywords = "normal,first,last,baseline,safe,unsafe,center,start,end,self-start,self-end,\
23                flex-start,flex-end",
24);
25
26crate::create_property!(
27    PlaceSelf,
28    display = "",
29    atomic = "place-s",
30    custom = false,
31    data_type = "",
32    initial_value = Normal,
33    keywords = "normal,first,last,baseline,safe,unsafe,center,start,end,self-start,self-end,\
34                flex-start,flex-end",
35);
36
37#[cfg(test)]
38mod test {
39    #[test]
40    fn place_content() {
41        let name = "place-content";
42        crate::test_property_initial_value!(PlaceContent, Normal);
43        crate::test_global_keywords!(PlaceContent, name);
44        crate::test_function_var!(PlaceContent, name);
45        #[cfg(feature = "atomic")]
46        crate::test_atomic_property!(PlaceContent, "place-c");
47    }
48
49    #[test]
50    fn place_items() {
51        let name = "place-items";
52        crate::test_property_initial_value!(PlaceItems, Normal);
53        crate::test_global_keywords!(PlaceItems, name);
54        crate::test_function_var!(PlaceItems, name);
55        #[cfg(feature = "atomic")]
56        crate::test_atomic_property!(PlaceItems, "place-i");
57    }
58
59    #[test]
60    fn place_self() {
61        let name = "place-self";
62        crate::test_property_initial_value!(PlaceSelf, Normal);
63        crate::test_global_keywords!(PlaceSelf, name);
64        crate::test_function_var!(PlaceSelf, name);
65        #[cfg(feature = "atomic")]
66        crate::test_atomic_property!(PlaceSelf, "place-s");
67    }
68}