css_ast/values/transitions/
mod.rs

1#![allow(warnings)]
2//! CSS Transitions Level 2
3//! https://drafts.csswg.org/css-transitions-2/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `transition-property` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-property).
9///
10/// 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.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// none | <single-transition-property>#
16/// ```
17///
18// https://drafts.csswg.org/css-transitions-2/#transition-property
19#[syntax(" none | <single-transition-property># ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22	initial = "all",
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.transition-property"))]
31#[visit]
32pub struct TransitionPropertyStyleValue<'a>;
33
34/// Represents the style value for `transition-duration` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-duration).
35///
36/// 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.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// <time [0s,∞]>#
42/// ```
43///
44// https://drafts.csswg.org/css-transitions-2/#transition-duration
45#[syntax(" <time [0s,∞]># ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48	initial = "0s",
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.transition-duration"))]
57#[visit]
58pub struct TransitionDurationStyleValue<'a>;
59
60/// Represents the style value for `transition-timing-function` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-timing-function).
61///
62/// 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.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// <easing-function>#
68/// ```
69///
70// https://drafts.csswg.org/css-transitions-2/#transition-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(
83	feature = "css_feature_data",
84	derive(ToCSSFeature),
85	css_feature("css.properties.transition-timing-function")
86)]
87#[visit]
88pub struct TransitionTimingFunctionStyleValue<'a>;
89
90/// Represents the style value for `transition-delay` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-delay).
91///
92/// 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.
93///
94/// The grammar is defined as:
95///
96/// ```text,ignore
97/// <time>#
98/// ```
99///
100// https://drafts.csswg.org/css-transitions-2/#transition-delay
101#[syntax(" <time># ")]
102#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
103#[style_value(
104	initial = "0s",
105	applies_to = "all elements",
106	inherited = "no",
107	percentages = "n/a",
108	canonical_order = "per grammar",
109	animation_type = "not animatable"
110)]
111#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
112#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition-delay"))]
113#[visit]
114pub struct TransitionDelayStyleValue<'a>;
115
116/// Represents the style value for `transition` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition).
117///
118/// 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.
119///
120/// The grammar is defined as:
121///
122/// ```text,ignore
123/// <single-transition>#
124/// ```
125///
126// https://drafts.csswg.org/css-transitions-2/#transition
127#[syntax(" <single-transition># ")]
128#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
129#[style_value(
130	initial = "see individual properties",
131	applies_to = "all elements",
132	inherited = "no",
133	percentages = "n/a",
134	canonical_order = "per grammar",
135	animation_type = "not animatable"
136)]
137#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
138#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition"))]
139#[visit]
140pub struct TransitionStyleValue<'a>;
141
142/// Represents the style value for `transition-behavior` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-behavior).
143///
144/// 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%.
145///
146/// The grammar is defined as:
147///
148/// ```text,ignore
149/// <transition-behavior-value>#
150/// ```
151///
152// https://drafts.csswg.org/css-transitions-2/#transition-behavior
153#[syntax(" <transition-behavior-value># ")]
154#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
155#[style_value(
156	initial = "normal",
157	applies_to = "all elements",
158	inherited = "no",
159	percentages = "n/a",
160	canonical_order = "per grammar",
161	animation_type = "not animatable"
162)]
163#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
164#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition-behavior"))]
165#[visit]
166pub struct TransitionBehaviorStyleValue<'a>;