polished_css/property/appearance/
animation.rs

1crate::create_property!(
2    AnimationComposition,
3    display = "",
4    atomic = "anim-c",
5    custom = false,
6    data_type = "",
7    initial_value = Replace,
8    keywords = "replace,add,accumulate",
9);
10
11crate::create_property!(
12    AnimationDelay,
13    display = "",
14    atomic = "anim-del",
15    custom = false,
16    data_type = "<time>",
17    initial_value = Initial,
18    keywords = "",
19);
20
21crate::create_property!(
22    AnimationDirection,
23    display = "",
24    atomic = "anim-dir",
25    custom = false,
26    data_type = "",
27    initial_value = Normal,
28    keywords = "normal,reverse,alternate,alternate-reverse",
29);
30
31crate::create_property!(
32    AnimationDuration,
33    display = "",
34    atomic = "anim-dur",
35    custom = false,
36    data_type = "<time>",
37    initial_value = Initial,
38    keywords = "auto",
39);
40
41crate::create_property!(
42    AnimationFillMode,
43    display = "",
44    atomic = "anim-f",
45    custom = false,
46    data_type = "",
47    initial_value = None,
48    keywords = "none,forwards,backwards,both",
49);
50
51crate::create_property!(
52    AnimationIterationCount,
53    display = "",
54    atomic = "anim-i",
55    custom = false,
56    data_type = "<number>",
57    initial_value = Initial,
58    keywords = "infinite",
59);
60
61crate::create_property!(
62    AnimationName,
63    display = "",
64    atomic = "anim-n",
65    custom = false,
66    data_type = "<custom-ident>",
67    initial_value = None,
68    keywords = "none",
69);
70
71crate::create_property!(
72    AnimationPlayState,
73    display = "",
74    atomic = "anim-p",
75    custom = false,
76    data_type = "",
77    initial_value = Running,
78    keywords = "running,paused",
79);
80
81crate::create_property!(
82    AnimationTimingFunction,
83    display = "",
84    atomic = "anim-fn",
85    custom = false,
86    data_type = "",
87    initial_value = Ease,
88    keywords = "linear,ease,ease-in,ease-out,ease-in-out,step-start,step-end,jump-start,jump-end,\
89                jump-none,jump-both,start,end",
90);
91
92#[cfg(test)]
93mod test {
94    #[test]
95    fn animation_composition() {
96        let name = "animation-composition";
97        crate::test_property_initial_value!(AnimationComposition, Replace);
98        crate::test_global_keywords!(AnimationComposition, name);
99        crate::test_function_var!(AnimationComposition, name);
100        #[cfg(feature = "atomic")]
101        crate::test_atomic_property!(AnimationComposition, "anim-c");
102    }
103
104    #[test]
105    fn animation_delay() {
106        let name = "animation-delay";
107        crate::test_property_initial_value!(AnimationDelay, Initial);
108        crate::test_global_keywords!(AnimationDelay, name);
109        crate::test_function_var!(AnimationDelay, name);
110        #[cfg(feature = "atomic")]
111        crate::test_atomic_property!(AnimationDelay, "anim-del");
112    }
113
114    #[test]
115    fn animation_direction() {
116        let name = "animation-direction";
117        crate::test_property_initial_value!(AnimationDirection, Normal);
118        crate::test_global_keywords!(AnimationDirection, name);
119        crate::test_function_var!(AnimationDirection, name);
120        #[cfg(feature = "atomic")]
121        crate::test_atomic_property!(AnimationDirection, "anim-dir");
122    }
123
124    #[test]
125    fn animation_duration() {
126        let name = "animation-duration";
127        crate::test_property_initial_value!(AnimationDuration, Initial);
128        crate::test_global_keywords!(AnimationDuration, name);
129        crate::test_function_var!(AnimationDuration, name);
130        #[cfg(feature = "atomic")]
131        crate::test_atomic_property!(AnimationDuration, "anim-dur");
132    }
133
134    #[test]
135    fn animation_iteration_count() {
136        let name = "animation-iteration-count";
137        crate::test_property_initial_value!(AnimationIterationCount, Initial);
138        crate::test_global_keywords!(AnimationIterationCount, name);
139        crate::test_function_var!(AnimationIterationCount, name);
140        #[cfg(feature = "atomic")]
141        crate::test_atomic_property!(AnimationIterationCount, "anim-i");
142    }
143
144    #[test]
145    fn animation_fill_mode() {
146        let name = "animation-fill-mode";
147        crate::test_property_initial_value!(AnimationFillMode, None);
148        crate::test_global_keywords!(AnimationFillMode, name);
149        crate::test_function_var!(AnimationFillMode, name);
150        #[cfg(feature = "atomic")]
151        crate::test_atomic_property!(AnimationFillMode, "anim-f");
152    }
153
154    #[test]
155    fn animation_name() {
156        let name = "animation-name";
157        crate::test_property_initial_value!(AnimationName, None);
158        crate::test_global_keywords!(AnimationName, name);
159        crate::test_function_var!(AnimationName, name);
160        #[cfg(feature = "atomic")]
161        crate::test_atomic_property!(AnimationName, "anim-n");
162    }
163
164    #[test]
165    fn animation_play_state() {
166        let name = "animation-play-state";
167        crate::test_property_initial_value!(AnimationPlayState, Running);
168        crate::test_global_keywords!(AnimationPlayState, name);
169        crate::test_function_var!(AnimationPlayState, name);
170        #[cfg(feature = "atomic")]
171        crate::test_atomic_property!(AnimationPlayState, "anim-p");
172    }
173
174    #[test]
175    fn animation_timing_function() {
176        let name = "animation-timing-function";
177        crate::test_property_initial_value!(AnimationTimingFunction, Ease);
178        crate::test_global_keywords!(AnimationTimingFunction, name);
179        crate::test_function_var!(AnimationTimingFunction, name);
180        #[cfg(feature = "atomic")]
181        crate::test_atomic_property!(AnimationTimingFunction, "anim-fn");
182    }
183}