polished_css/macros/
property.rs

1#[macro_export]
2macro_rules! create_property {
3    (
4        $property:ident,display =
5        $display:literal,atomic =
6        $atomic:literal,custom =
7        $custom:expr,data_type =
8        $data_type:literal,initial_value =
9        $initial_value:ident,keywords =
10        $keywords:literal,
11    ) => {
12        ::paste::paste! {
13            #[doc = "[MDN documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/" $property:lower ")"]
14            #[derive(
15                Clone,
16                Debug,
17                PartialEq,
18                polished_css_macros::Atomic,
19                polished_css_macros::Default,
20                polished_css_macros::Display,
21                polished_css_macros::Property,
22                polished_css_macros::PropertyName,
23                polished_css_macros::PropertyValue,
24                polished_css_macros::PropertyImpl,
25                polished_css_macros::PropertyFromDataType,
26                polished_css_macros::UnitDataTypeContainer,
27            )]
28            #[atomic(name = $atomic)]
29            #[default(value = $initial_value)]
30            #[property(custom = $custom, display = $display, data_type = $data_type, keywords = $keywords)]
31            pub struct $property<T>(pub T)
32            where
33                T: Clone
34                    + std::fmt::Debug
35                    + std::fmt::Display
36                    + PartialEq
37                    + $crate::utils::UnitDataType<Self>;
38            }
39        }
40}