css_ast/values/transitions/
mod.rs

1#![allow(warnings)]
2//! https://drafts.csswg.org/css-transitions-2/
3
4mod impls;
5use super::prelude::*;
6use impls::*;
7/// Represents the style value for `transition` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition).
8///
9/// 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.
10///
11/// The grammar is defined as:
12///
13/// ```text,ignore
14/// <single-transition>#
15/// ```
16///
17/// https://drafts.csswg.org/css-transitions-2/#transition
18#[syntax(" <single-transition># ")]
19#[derive(
20	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
21)]
22#[declaration_metadata(
23    initial = "see individual properties",
24    applies_to = Elements,
25    property_group = Transitions,
26    computed_value_type = Unknown,
27    canonical_order = "per grammar",
28)]
29#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition"))]
31#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
32pub struct TransitionStyleValue<'a>;
33
34/// Represents the style value for `transition-behavior` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-behavior).
35///
36/// 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%.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// <transition-behavior-value>#
42/// ```
43///
44/// https://drafts.csswg.org/css-transitions-2/#transition-behavior
45#[syntax(" <transition-behavior-value># ")]
46#[derive(
47	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
48)]
49#[declaration_metadata(
50    initial = "normal",
51    applies_to = Elements,
52    property_group = Transitions,
53    computed_value_type = AsSpecified,
54    canonical_order = "per grammar",
55)]
56#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
57#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition-behavior"))]
58#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
59pub struct TransitionBehaviorStyleValue<'a>;
60
61/// Represents the style value for `transition-delay` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-delay).
62///
63/// 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.
64///
65/// The grammar is defined as:
66///
67/// ```text,ignore
68/// <time>#
69/// ```
70///
71/// https://drafts.csswg.org/css-transitions-2/#transition-delay
72#[syntax(" <time># ")]
73#[derive(
74	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
75)]
76#[declaration_metadata(
77    initial = "0s",
78    applies_to = Elements,
79    property_group = Transitions,
80    computed_value_type = Unknown,
81    canonical_order = "per grammar",
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(
101	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
102)]
103#[declaration_metadata(
104    initial = "0s",
105    applies_to = Elements,
106    property_group = Transitions,
107    computed_value_type = Unknown,
108    canonical_order = "per grammar",
109)]
110#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
111#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition-duration"))]
112#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
113pub struct TransitionDurationStyleValue<'a>;
114
115/// Represents the style value for `transition-property` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-property).
116///
117/// 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.
118///
119/// The grammar is defined as:
120///
121/// ```text,ignore
122/// none | <single-transition-property>#
123/// ```
124///
125/// https://drafts.csswg.org/css-transitions-2/#transition-property
126#[syntax(" none | <single-transition-property># ")]
127#[derive(
128	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
129)]
130#[declaration_metadata(
131    initial = "all",
132    applies_to = Elements,
133    property_group = Transitions,
134    computed_value_type = Unknown,
135    canonical_order = "per grammar",
136)]
137#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
138#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transition-property"))]
139#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
140pub struct TransitionPropertyStyleValue<'a>;
141
142/// Represents the style value for `transition-timing-function` as defined in [css-transitions-2](https://drafts.csswg.org/css-transitions-2/#transition-timing-function).
143///
144/// 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.
145///
146/// The grammar is defined as:
147///
148/// ```text,ignore
149/// <easing-function>#
150/// ```
151///
152/// https://drafts.csswg.org/css-transitions-2/#transition-timing-function
153#[syntax(" <easing-function># ")]
154#[derive(
155	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
156)]
157#[declaration_metadata(
158    initial = "ease",
159    applies_to = Elements,
160    property_group = Transitions,
161    computed_value_type = AsSpecified,
162    canonical_order = "per grammar",
163)]
164#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
165#[cfg_attr(
166	feature = "css_feature_data",
167	derive(ToCSSFeature),
168	css_feature("css.properties.transition-timing-function")
169)]
170#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
171pub struct TransitionTimingFunctionStyleValue<'a>;