css_ast/values/transitions/
mod.rs

1#![allow(warnings)]
2//! CSS Transitions Module Level 2
3//! https://drafts.csswg.org/css-transitions-2/
4
5mod impls;
6
7use super::prelude::*;
8use impls::*;
9
10/// Represents the style value for `transition` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition).
11///
12/// The transition shorthand CSS property sets how changes to an element's styles may occur over time. Transitions can be applied to specific CSS properties, all properties, or none.
13///
14/// The grammar is defined as:
15///
16/// ```text,ignore
17/// <single-transition>#
18/// ```
19///
20// https://drafts.csswg.org/css-transitions-2/#transition
21#[syntax(" <single-transition># ")]
22#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
23#[style_value(
24	initial = "see individual properties",
25	applies_to = "all elements",
26	inherited = "no",
27	percentages = "n/a",
28	canonical_order = "per grammar",
29	animation_type = "not animatable"
30)]
31#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
32#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition"))]
33#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
34pub struct TransitionStyleValue<'a>;
35
36/// Represents the style value for `transition-behavior` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-behavior).
37///
38/// The transition-behavior: allow-discrete CSS declaration allows transitions for properties whose animation behavior is discrete. Such properties can't be interpolated and swap from their start value to the end value at 50%.
39///
40/// The grammar is defined as:
41///
42/// ```text,ignore
43/// <transition-behavior-value>#
44/// ```
45///
46// https://drafts.csswg.org/css-transitions-2/#transition-behavior
47#[syntax(" <transition-behavior-value># ")]
48#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
49#[style_value(
50	initial = "normal",
51	applies_to = "all elements",
52	inherited = "no",
53	percentages = "n/a",
54	canonical_order = "per grammar",
55	animation_type = "not animatable"
56)]
57#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
58#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition-behavior"))]
59#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
60pub struct TransitionBehaviorStyleValue<'a>;
61
62/// Represents the style value for `transition-delay` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-delay).
63///
64/// The transition shorthand CSS property sets how changes to an element's styles may occur over time. Transitions can be applied to specific CSS properties, all properties, or none.
65///
66/// The grammar is defined as:
67///
68/// ```text,ignore
69/// <time>#
70/// ```
71///
72// https://drafts.csswg.org/css-transitions-2/#transition-delay
73#[syntax(" <time># ")]
74#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
75#[style_value(
76	initial = "0s",
77	applies_to = "all elements",
78	inherited = "no",
79	percentages = "n/a",
80	canonical_order = "per grammar",
81	animation_type = "not animatable"
82)]
83#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
84#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition-delay"))]
85#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
86pub struct TransitionDelayStyleValue<'a>;
87
88/// Represents the style value for `transition-duration` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-duration).
89///
90/// The transition shorthand CSS property sets how changes to an element's styles may occur over time. Transitions can be applied to specific CSS properties, all properties, or none.
91///
92/// The grammar is defined as:
93///
94/// ```text,ignore
95/// <time [0s,∞]>#
96/// ```
97///
98// https://drafts.csswg.org/css-transitions-2/#transition-duration
99#[syntax(" <time [0s,∞]># ")]
100#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
101#[style_value(
102	initial = "0s",
103	applies_to = "all elements",
104	inherited = "no",
105	percentages = "n/a",
106	canonical_order = "per grammar",
107	animation_type = "not animatable"
108)]
109#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
110#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition-duration"))]
111#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
112pub struct TransitionDurationStyleValue<'a>;
113
114/// Represents the style value for `transition-property` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-property).
115///
116/// The transition shorthand CSS property sets how changes to an element's styles may occur over time. Transitions can be applied to specific CSS properties, all properties, or none.
117///
118/// The grammar is defined as:
119///
120/// ```text,ignore
121/// none | <single-transition-property>#
122/// ```
123///
124// https://drafts.csswg.org/css-transitions-2/#transition-property
125#[syntax(" none | <single-transition-property># ")]
126#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
127#[style_value(
128	initial = "all",
129	applies_to = "all elements",
130	inherited = "no",
131	percentages = "n/a",
132	canonical_order = "per grammar",
133	animation_type = "not animatable"
134)]
135#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
136#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition-property"))]
137#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
138pub struct TransitionPropertyStyleValue<'a>;
139
140/// Represents the style value for `transition-timing-function` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-timing-function).
141///
142/// The transition shorthand CSS property sets how changes to an element's styles may occur over time. Transitions can be applied to specific CSS properties, all properties, or none.
143///
144/// The grammar is defined as:
145///
146/// ```text,ignore
147/// <easing-function>#
148/// ```
149///
150// https://drafts.csswg.org/css-transitions-2/#transition-timing-function
151#[syntax(" <easing-function># ")]
152#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
153#[style_value(
154	initial = "ease",
155	applies_to = "all elements",
156	inherited = "no",
157	percentages = "n/a",
158	canonical_order = "per grammar",
159	animation_type = "not animatable"
160)]
161#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
162#[cfg_attr(
163	feature = "css_feature_data",
164	derive(ToCSSFeature),
165	css_feature("css.properties.transition-timing-function")
166)]
167#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
168pub struct TransitionTimingFunctionStyleValue<'a>;