polished_css/property/layout/
inset.rs

1macro_rules! create_struct {
2    ($property:ident, $atomic:literal) => {
3        $crate::create_property!(
4            $property,
5            display = "",
6            atomic = $atomic,
7            custom = false,
8            data_type = "<length-percentage>",
9            initial_value = Auto,
10            keywords = "auto",
11        );
12    };
13}
14
15create_struct!(Inset, "inset");
16create_struct!(InsetBlock, "inset-bl");
17create_struct!(InsetInline, "inset-in");
18
19create_struct!(Top, "t");
20create_struct!(Bottom, "b");
21create_struct!(Left, "l");
22create_struct!(Right, "r");
23
24#[cfg(test)]
25mod test {
26    #[test]
27    fn insets() {
28        macro_rules! test_property {
29            ($property:ident, $name:expr, $atomic:expr) => {
30                crate::test_property_initial_value!($property, Auto);
31                crate::test_global_keywords!($property, $name);
32                crate::test_function_var!($property, $name);
33                #[cfg(feature = "atomic")]
34                crate::test_atomic_property!($property, $atomic);
35            };
36        }
37
38        test_property!(Inset, "inset", "inset");
39        test_property!(InsetBlock, "inset-block", "inset-bl");
40        test_property!(InsetInline, "inset-inline", "inset-in");
41
42        test_property!(Top, "top", "t");
43        test_property!(Bottom, "bottom", "b");
44        test_property!(Left, "left", "l");
45        test_property!(Right, "right", "r");
46    }
47}