css_ast/values/animations/mod.rs
1#![allow(warnings)]
2//! CSS Animations Level 2
3//! https://drafts.csswg.org/css-animations-2/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `animation-name` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-name).
9///
10/// The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// [ none | <keyframes-name> ]#
16/// ```
17///
18// https://drafts.csswg.org/css-animations-2/#animation-name
19#[syntax(" [ none | <keyframes-name> ]# ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22 initial = "none",
23 applies_to = "all elements",
24 inherited = "no",
25 percentages = "n/a",
26 canonical_order = "per grammar",
27 animation_type = "not animatable"
28)]
29#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-name"))]
31#[visit]
32pub struct AnimationNameStyleValue<'a>;
33
34/// Represents the style value for `animation-duration` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-duration).
35///
36/// The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// [ auto | <time [0s,∞]> ]#
42/// ```
43///
44// https://drafts.csswg.org/css-animations-2/#animation-duration
45#[syntax(" [ auto | <time [0s,∞]> ]# ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48 initial = "auto",
49 applies_to = "all elements",
50 inherited = "no",
51 percentages = "n/a",
52 canonical_order = "per grammar",
53 animation_type = "not animatable"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-duration"))]
57#[visit]
58pub struct AnimationDurationStyleValue<'a>;
59
60/// Represents the style value for `animation-timing-function` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-timing-function).
61///
62/// The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// <easing-function>#
68/// ```
69///
70// https://drafts.csswg.org/css-animations-2/#animation-timing-function
71#[syntax(" <easing-function># ")]
72#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73#[style_value(
74 initial = "ease",
75 applies_to = "all elements",
76 inherited = "no",
77 percentages = "n/a",
78 canonical_order = "per grammar",
79 animation_type = "not animatable"
80)]
81#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-timing-function"))]
83#[visit]
84pub struct AnimationTimingFunctionStyleValue<'a>;
85
86/// Represents the style value for `animation-iteration-count` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-iteration-count).
87///
88/// The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// <single-animation-iteration-count>#
94/// ```
95///
96// https://drafts.csswg.org/css-animations-2/#animation-iteration-count
97#[syntax(" <single-animation-iteration-count># ")]
98#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99#[style_value(
100 initial = "1",
101 applies_to = "all elements",
102 inherited = "no",
103 percentages = "n/a",
104 canonical_order = "per grammar",
105 animation_type = "not animatable"
106)]
107#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
108#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-iteration-count"))]
109#[visit]
110pub struct AnimationIterationCountStyleValue<'a>;
111
112/// Represents the style value for `animation-direction` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-direction).
113///
114/// The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.
115///
116/// The grammar is defined as:
117///
118/// ```text,ignore
119/// <single-animation-direction>#
120/// ```
121///
122// https://drafts.csswg.org/css-animations-2/#animation-direction
123#[syntax(" <single-animation-direction># ")]
124#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
125#[style_value(
126 initial = "normal",
127 applies_to = "all elements",
128 inherited = "no",
129 percentages = "n/a",
130 canonical_order = "per grammar",
131 animation_type = "not animatable"
132)]
133#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
134#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-direction"))]
135#[visit]
136pub struct AnimationDirectionStyleValue<'a>;
137
138/// Represents the style value for `animation-play-state` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-play-state).
139///
140/// The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.
141///
142/// The grammar is defined as:
143///
144/// ```text,ignore
145/// <single-animation-play-state>#
146/// ```
147///
148// https://drafts.csswg.org/css-animations-2/#animation-play-state
149#[syntax(" <single-animation-play-state># ")]
150#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
151#[style_value(
152 initial = "running",
153 applies_to = "all elements",
154 inherited = "no",
155 percentages = "n/a",
156 canonical_order = "per grammar",
157 animation_type = "not animatable"
158)]
159#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
160#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-play-state"))]
161#[visit]
162pub struct AnimationPlayStateStyleValue<'a>;
163
164/// Represents the style value for `animation-delay` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-delay).
165///
166/// The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.
167///
168/// The grammar is defined as:
169///
170/// ```text,ignore
171/// <time>#
172/// ```
173///
174// https://drafts.csswg.org/css-animations-2/#animation-delay
175#[syntax(" <time># ")]
176#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
177#[style_value(
178 initial = "0s",
179 applies_to = "all elements",
180 inherited = "no",
181 percentages = "n/a",
182 canonical_order = "per grammar",
183 animation_type = "not animatable"
184)]
185#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
186#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-delay"))]
187#[visit]
188pub struct AnimationDelayStyleValue<'a>;
189
190/// Represents the style value for `animation-fill-mode` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-fill-mode).
191///
192/// The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.
193///
194/// The grammar is defined as:
195///
196/// ```text,ignore
197/// <single-animation-fill-mode>#
198/// ```
199///
200// https://drafts.csswg.org/css-animations-2/#animation-fill-mode
201#[syntax(" <single-animation-fill-mode># ")]
202#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
203#[style_value(
204 initial = "none",
205 applies_to = "all elements",
206 inherited = "no",
207 percentages = "n/a",
208 canonical_order = "per grammar",
209 animation_type = "not animatable"
210)]
211#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
212#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-fill-mode"))]
213#[visit]
214pub struct AnimationFillModeStyleValue<'a>;
215
216// /// Represents the style value for `animation` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation).
217// ///
218// /// The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.
219// ///
220// /// The grammar is defined as:
221// ///
222// /// ```text,ignore
223// /// <single-animation>#
224// /// ```
225// ///
226// // https://drafts.csswg.org/css-animations-2/#animation
227// #[syntax(" <single-animation># ")]
228// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
229// #[style_value(
230// initial = "see individual properties",
231// applies_to = "all elements",
232// inherited = "no",
233// percentages = "n/a",
234// canonical_order = "per grammar",
235// animation_type = "not animatable",
236// )]
237// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
238// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation"))]
239// #[visit]
240// pub struct AnimationStyleValue<'a>;
241
242/// Represents the style value for `animation-composition` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-composition).
243///
244/// The animation-composition CSS property chooses how to combine animations that affect the same property.
245///
246/// The grammar is defined as:
247///
248/// ```text,ignore
249/// <single-animation-composition>#
250/// ```
251///
252// https://drafts.csswg.org/css-animations-2/#animation-composition
253#[syntax(" <single-animation-composition># ")]
254#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
255#[style_value(
256 initial = "replace",
257 applies_to = "all elements",
258 inherited = "no",
259 percentages = "n/a",
260 canonical_order = "per grammar",
261 animation_type = "not animatable"
262)]
263#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
264#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-composition"))]
265#[visit]
266pub struct AnimationCompositionStyleValue<'a>;
267
268/// Represents the style value for `animation-timeline` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-timeline).
269///
270/// The animation-timeline, scroll-timeline, and view-timeline CSS properties advance animations based on the user's scroll position.
271///
272/// The grammar is defined as:
273///
274/// ```text,ignore
275/// <single-animation-timeline>#
276/// ```
277///
278// https://drafts.csswg.org/css-animations-2/#animation-timeline
279#[syntax(" <single-animation-timeline># ")]
280#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
281#[style_value(
282 initial = "auto",
283 applies_to = "all elements",
284 inherited = "no",
285 percentages = "n/a",
286 canonical_order = "per grammar",
287 animation_type = "not animatable"
288)]
289#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
290#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-timeline"))]
291#[visit]
292pub struct AnimationTimelineStyleValue<'a>;
293
294/// Represents the style value for `animation-trigger-behavior` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-trigger-behavior).
295///
296/// The grammar is defined as:
297///
298/// ```text,ignore
299/// <single-animation-trigger-behavior>#
300/// ```
301///
302// https://drafts.csswg.org/css-animations-2/#animation-trigger-behavior
303#[syntax(" <single-animation-trigger-behavior># ")]
304#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
305#[style_value(
306 initial = "once",
307 applies_to = "all elements",
308 inherited = "no",
309 percentages = "n/a",
310 canonical_order = "per grammar",
311 animation_type = "not animatable"
312)]
313#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
314#[cfg_attr(
315 feature = "css_feature_data",
316 derive(ToCSSFeature),
317 css_feature("css.properties.animation-trigger-behavior")
318)]
319#[visit]
320pub struct AnimationTriggerBehaviorStyleValue<'a>;
321
322/// Represents the style value for `animation-trigger-timeline` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-trigger-timeline).
323///
324/// The grammar is defined as:
325///
326/// ```text,ignore
327/// <single-animation-timeline>#
328/// ```
329///
330// https://drafts.csswg.org/css-animations-2/#animation-trigger-timeline
331#[syntax(" <single-animation-timeline># ")]
332#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
333#[style_value(
334 initial = "auto",
335 applies_to = "all elements",
336 inherited = "no",
337 percentages = "n/a",
338 canonical_order = "per grammar",
339 animation_type = "not animatable"
340)]
341#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
342#[cfg_attr(
343 feature = "css_feature_data",
344 derive(ToCSSFeature),
345 css_feature("css.properties.animation-trigger-timeline")
346)]
347#[visit]
348pub struct AnimationTriggerTimelineStyleValue<'a>;
349
350// /// Represents the style value for `animation-trigger-range` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-trigger-range).
351// ///
352// /// The grammar is defined as:
353// ///
354// /// ```text,ignore
355// /// [ <'animation-trigger-range-start'> <'animation-trigger-range-end'>? ]#
356// /// ```
357// ///
358// // https://drafts.csswg.org/css-animations-2/#animation-trigger-range
359// #[syntax(" [ <'animation-trigger-range-start'> <'animation-trigger-range-end'>? ]# ")]
360// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
361// #[style_value(
362// initial = "see individual properties",
363// applies_to = "see individual properties",
364// inherited = "see individual properties",
365// percentages = "see individual properties",
366// canonical_order = "per grammar",
367// animation_type = "see individual properties",
368// )]
369// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
370// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-trigger-range"))]
371// #[visit]
372// pub struct AnimationTriggerRangeStyleValue<'a>;
373
374// /// Represents the style value for `animation-trigger-range-start` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-trigger-range-start).
375// ///
376// /// The grammar is defined as:
377// ///
378// /// ```text,ignore
379// /// [ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#
380// /// ```
381// ///
382// // https://drafts.csswg.org/css-animations-2/#animation-trigger-range-start
383// #[syntax(" [ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]# ")]
384// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
385// #[style_value(
386// initial = "normal",
387// applies_to = "all elements",
388// inherited = "no",
389// percentages = "relative to the specified named timeline range if one was specified, else to the entire timeline",
390// canonical_order = "per grammar",
391// animation_type = "not animatable",
392// )]
393// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
394// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-trigger-range-start"))]
395// #[visit]
396// pub struct AnimationTriggerRangeStartStyleValue<'a>;
397
398// /// Represents the style value for `animation-trigger-range-end` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-trigger-range-end).
399// ///
400// /// The grammar is defined as:
401// ///
402// /// ```text,ignore
403// /// [ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#
404// /// ```
405// ///
406// // https://drafts.csswg.org/css-animations-2/#animation-trigger-range-end
407// #[syntax(" [ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]# ")]
408// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
409// #[style_value(
410// initial = "normal",
411// applies_to = "all elements",
412// inherited = "no",
413// percentages = "relative to the specified named timeline range if one was specified, else to the entire timeline",
414// canonical_order = "per grammar",
415// animation_type = "not animatable",
416// )]
417// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
418// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-trigger-range-end"))]
419// #[visit]
420// pub struct AnimationTriggerRangeEndStyleValue<'a>;
421
422// /// Represents the style value for `animation-trigger-exit-range` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-trigger-exit-range).
423// ///
424// /// The grammar is defined as:
425// ///
426// /// ```text,ignore
427// /// [ <'animation-trigger-exit-range-start'> <'animation-trigger-exit-range-end'>? ]#
428// /// ```
429// ///
430// // https://drafts.csswg.org/css-animations-2/#animation-trigger-exit-range
431// #[syntax(" [ <'animation-trigger-exit-range-start'> <'animation-trigger-exit-range-end'>? ]# ")]
432// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
433// #[style_value(
434// initial = "see individual properties",
435// applies_to = "see individual properties",
436// inherited = "see individual properties",
437// percentages = "see individual properties",
438// canonical_order = "per grammar",
439// animation_type = "see individual properties",
440// )]
441// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
442// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-trigger-exit-range"))]
443// #[visit]
444// pub struct AnimationTriggerExitRangeStyleValue<'a>;
445
446// /// Represents the style value for `animation-trigger-exit-range-start` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-trigger-exit-range-start).
447// ///
448// /// The grammar is defined as:
449// ///
450// /// ```text,ignore
451// /// [ auto | normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#
452// /// ```
453// ///
454// // https://drafts.csswg.org/css-animations-2/#animation-trigger-exit-range-start
455// #[syntax(" [ auto | normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]# ")]
456// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
457// #[style_value(
458// initial = "auto",
459// applies_to = "all elements",
460// inherited = "no",
461// percentages = "relative to the specified named timeline range if one was specified, else to the entire timeline",
462// canonical_order = "per grammar",
463// animation_type = "not animatable",
464// )]
465// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
466// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-trigger-exit-range-start"))]
467// #[visit]
468// pub struct AnimationTriggerExitRangeStartStyleValue<'a>;
469
470// /// Represents the style value for `animation-trigger-exit-range-end` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-trigger-exit-range-end).
471// ///
472// /// The grammar is defined as:
473// ///
474// /// ```text,ignore
475// /// [ auto | normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#
476// /// ```
477// ///
478// // https://drafts.csswg.org/css-animations-2/#animation-trigger-exit-range-end
479// #[syntax(" [ auto | normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]# ")]
480// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
481// #[style_value(
482// initial = "auto",
483// applies_to = "all elements",
484// inherited = "no",
485// percentages = "relative to the specified named timeline range if one was specified, else to the entire timeline",
486// canonical_order = "per grammar",
487// animation_type = "not animatable",
488// )]
489// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
490// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-trigger-exit-range-end"))]
491// #[visit]
492// pub struct AnimationTriggerExitRangeEndStyleValue<'a>;
493
494/// Represents the style value for `animation-trigger` as defined in [css-animations-2](https://drafts.csswg.org/css-animations-2/#animation-trigger).
495///
496/// The grammar is defined as:
497///
498/// ```text,ignore
499/// <single-animation-trigger>#
500/// ```
501///
502// https://drafts.csswg.org/css-animations-2/#animation-trigger
503#[syntax(" <single-animation-trigger># ")]
504#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
505#[style_value(
506 initial = "see individual properties",
507 applies_to = "all elements",
508 inherited = "no",
509 percentages = "n/a",
510 canonical_order = "per grammar",
511 animation_type = "not animatable"
512)]
513#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
514#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.animation-trigger"))]
515#[visit]
516pub struct AnimationTriggerStyleValue<'a>;