css_ast/values/transforms/mod.rs
1// AUTO-GENERATED from w3c/csswg-drafts
2// Commit: https://github.com/w3c/csswg-drafts/commit/7e27ad7484307dfdbe9d0e18ad19d02859389688
3// Do not edit this file directly.
4#![allow(warnings)]
5//! https://drafts.csswg.org/css-transforms-2/
6
7mod impls;
8use super::prelude::*;
9use impls::*;
10/// Represents the style value for `backface-visibility` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#backface-visibility).
11///
12/// The transform CSS property and its 3D transform functions allow rotations and other transforms in three dimensions, including perspective transforms.
13///
14/// The grammar is defined as:
15///
16/// ```text,ignore
17/// visible | hidden
18/// ```
19///
20/// https://drafts.csswg.org/css-transforms-2/#backface-visibility
21#[syntax(" visible | hidden ")]
22#[derive(
23 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
24)]
25#[declaration_metadata(
26 initial = "visible",
27 applies_to = Unknown,
28 animation_type = Discrete,
29 property_group = Transforms,
30 computed_value_type = Unknown,
31 canonical_order = "per grammar",
32)]
33#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
34#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.backface-visibility"))]
35#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
36#[derive(csskit_derives::NodeWithMetadata)]
37pub enum BackfaceVisibilityStyleValue {}
38
39/// Represents the style value for `perspective` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#perspective).
40///
41/// The transform CSS property and its 3D transform functions allow rotations and other transforms in three dimensions, including perspective transforms.
42///
43/// The grammar is defined as:
44///
45/// ```text,ignore
46/// none | <length [0,∞]>
47/// ```
48///
49/// https://drafts.csswg.org/css-transforms-2/#perspective
50#[syntax(" none | <length [0,∞]> ")]
51#[derive(
52 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
53)]
54#[declaration_metadata(
55 initial = "none",
56 applies_to = Unknown,
57 animation_type = ByComputedValue,
58 property_group = Transforms,
59 computed_value_type = AbsoluteLengthOrNone,
60 canonical_order = "per grammar",
61)]
62#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
63#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.perspective"))]
64#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
65#[derive(csskit_derives::NodeWithMetadata)]
66pub struct PerspectiveStyleValue;
67
68/// Represents the style value for `perspective-origin` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#perspective-origin).
69///
70/// The transform CSS property and its 3D transform functions allow rotations and other transforms in three dimensions, including perspective transforms.
71///
72/// The grammar is defined as:
73///
74/// ```text,ignore
75/// <position>
76/// ```
77///
78/// https://drafts.csswg.org/css-transforms-2/#perspective-origin
79#[syntax(" <position> ")]
80#[derive(
81 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
82)]
83#[declaration_metadata(
84 initial = "50% 50%",
85 applies_to = Unknown,
86 animation_type = ByComputedValue,
87 percentages = ReferenceBox,
88 property_group = Transforms,
89 computed_value_type = Unknown,
90 canonical_order = "per grammar",
91)]
92#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
93#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.perspective-origin"))]
94#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
95#[derive(csskit_derives::NodeWithMetadata)]
96pub struct PerspectiveOriginStyleValue;
97
98// /// Represents the style value for `rotate` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#rotate).
99// ///
100// /// The translate, rotate, and scale CSS properties apply single transformations independently, as opposed to applying multiple transformations with the transform CSS property.
101// ///
102// /// The grammar is defined as:
103// ///
104// /// ```text,ignore
105// /// none | <angle> | [ x | y | z | <number>{3} ] && <angle>
106// /// ```
107// ///
108// /// https://drafts.csswg.org/css-transforms-2/#rotate
109// #[syntax(" none | <angle> | [ x | y | z | <number>{3} ] && <angle> ")]
110// #[derive(
111// Parse,
112// Peek,
113// ToSpan,
114// ToCursors,
115// DeclarationMetadata,
116// SemanticEq,
117// Debug,
118// Clone,
119// PartialEq,
120// Eq,
121// PartialOrd,
122// Ord,
123// Hash,
124// )]
125// #[declaration_metadata(
126// initial = "none",
127// applies_to = Unknown,
128// animation_type = Unknown,
129// property_group = Transforms,
130// computed_value_type = Unknown,
131// canonical_order = "per grammar",
132// )]
133// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
134// #[cfg_attr(
135// feature = "css_feature_data",
136// derive(ToCSSFeature),
137// css_feature("css.properties.rotate")
138// )]
139// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
140// #[derive(csskit_derives::NodeWithMetadata)]
141// pub enum RotateStyleValue {}
142
143/// Represents the style value for `scale` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#scale).
144///
145/// The translate, rotate, and scale CSS properties apply single transformations independently, as opposed to applying multiple transformations with the transform CSS property.
146///
147/// The grammar is defined as:
148///
149/// ```text,ignore
150/// none | [ <number> | <percentage> ]{1,3}
151/// ```
152///
153/// https://drafts.csswg.org/css-transforms-2/#scale
154#[syntax(" none | [ <number> | <percentage> ]{1,3} ")]
155#[derive(
156 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
157)]
158#[declaration_metadata(
159 initial = "none",
160 applies_to = Unknown,
161 animation_type = ByComputedValue,
162 property_group = Transforms,
163 computed_value_type = Unknown,
164 canonical_order = "per grammar",
165)]
166#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
167#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.scale"))]
168#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
169#[derive(csskit_derives::NodeWithMetadata)]
170pub struct ScaleStyleValue;
171
172/// Represents the style value for `transform` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#transform).
173///
174/// The transform CSS property and its 2D transform functions allow rotating, scaling, skewing, and translating an element. Arbitrary 2D transforms are also possible using a transformation matrix.
175///
176/// The grammar is defined as:
177///
178/// ```text,ignore
179/// none | <transform-list>
180/// ```
181///
182/// https://drafts.csswg.org/css-transforms-2/#transform
183#[syntax(" none | <transform-list> ")]
184#[derive(
185 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
186)]
187#[declaration_metadata(
188 initial = "none",
189 applies_to = Unknown,
190 animation_type = TransformList,
191 percentages = ReferenceBox,
192 property_group = Transforms,
193 computed_value_type = AsSpecified,
194 canonical_order = "per grammar",
195)]
196#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
197#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transform"))]
198#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
199#[derive(csskit_derives::NodeWithMetadata)]
200pub struct TransformStyleValue<'a>;
201
202/// Represents the style value for `transform-box` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#transform-box).
203///
204/// The transform-box CSS property sets the position and dimensions of the reference box relative to which an element's transformations are calculated.
205///
206/// The grammar is defined as:
207///
208/// ```text,ignore
209/// content-box | border-box | fill-box | stroke-box | view-box
210/// ```
211///
212/// https://drafts.csswg.org/css-transforms-2/#transform-box
213#[syntax(" content-box | border-box | fill-box | stroke-box | view-box ")]
214#[derive(
215 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
216)]
217#[declaration_metadata(
218 initial = "view-box",
219 applies_to = Unknown,
220 animation_type = Discrete,
221 property_group = Transforms,
222 computed_value_type = Unknown,
223 canonical_order = "per grammar",
224)]
225#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
226#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transform-box"))]
227#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
228#[derive(csskit_derives::NodeWithMetadata)]
229pub enum TransformBoxStyleValue {}
230
231// /// Represents the style value for `transform-origin` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#transform-origin).
232// ///
233// /// The transform CSS property and its 2D transform functions allow rotating, scaling, skewing, and translating an element. Arbitrary 2D transforms are also possible using a transformation matrix.
234// ///
235// /// The grammar is defined as:
236// ///
237// /// ```text,ignore
238// /// [ left | center | right | top | bottom | <length-percentage> ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] <length>? | [ [ center | left | right ] && [ center | top | bottom ] ] <length>?
239// /// ```
240// ///
241// /// https://drafts.csswg.org/css-transforms-2/#transform-origin
242// #[syntax(
243// " [ left | center | right | top | bottom | <length-percentage> ] | \u{a0}\u{a0}[ left | center | right | <length-percentage> ]\u{a0}\u{a0}[ top | center | bottom | <length-percentage> ] <length>? |\u{a0}\u{a0}[ [ center | left | right ] && [ center | top | bottom ] ] <length>? "
244// )]
245// #[derive(
246// Parse,
247// Peek,
248// ToSpan,
249// ToCursors,
250// DeclarationMetadata,
251// SemanticEq,
252// Debug,
253// Clone,
254// PartialEq,
255// Eq,
256// PartialOrd,
257// Ord,
258// Hash,
259// )]
260// #[declaration_metadata(
261// initial = "50% 50%",
262// applies_to = Unknown,
263// animation_type = ByComputedValue,
264// percentages = ReferenceBox,
265// property_group = Transforms,
266// computed_value_type = Unknown,
267// canonical_order = "per grammar",
268// )]
269// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
270// #[cfg_attr(
271// feature = "css_feature_data",
272// derive(ToCSSFeature),
273// css_feature("css.properties.transform-origin")
274// )]
275// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
276// #[derive(csskit_derives::NodeWithMetadata)]
277// pub enum TransformOriginStyleValue {}
278
279/// Represents the style value for `transform-style` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#transform-style).
280///
281/// The transform CSS property and its 3D transform functions allow rotations and other transforms in three dimensions, including perspective transforms.
282///
283/// The grammar is defined as:
284///
285/// ```text,ignore
286/// flat | preserve-3d
287/// ```
288///
289/// https://drafts.csswg.org/css-transforms-2/#transform-style
290#[syntax(" flat | preserve-3d ")]
291#[derive(
292 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
293)]
294#[declaration_metadata(
295 initial = "flat",
296 applies_to = Unknown,
297 animation_type = Discrete,
298 property_group = Transforms,
299 computed_value_type = Unknown,
300 canonical_order = "per grammar",
301)]
302#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
303#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transform-style"))]
304#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
305#[derive(csskit_derives::NodeWithMetadata)]
306pub enum TransformStyleStyleValue {}
307
308// /// Represents the style value for `translate` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#translate).
309// ///
310// /// The translate, rotate, and scale CSS properties apply single transformations independently, as opposed to applying multiple transformations with the transform CSS property.
311// ///
312// /// The grammar is defined as:
313// ///
314// /// ```text,ignore
315// /// none | <length-percentage> [ <length-percentage> <length>? ]?
316// /// ```
317// ///
318// /// https://drafts.csswg.org/css-transforms-2/#translate
319// #[syntax(" none | <length-percentage> [ <length-percentage> <length>? ]? ")]
320// #[derive(
321// Parse,
322// Peek,
323// ToSpan,
324// ToCursors,
325// DeclarationMetadata,
326// SemanticEq,
327// Debug,
328// Clone,
329// PartialEq,
330// Eq,
331// PartialOrd,
332// Ord,
333// Hash,
334// )]
335// #[declaration_metadata(
336// initial = "none",
337// applies_to = Unknown,
338// animation_type = ByComputedValue,
339// percentages = ReferenceBox,
340// property_group = Transforms,
341// computed_value_type = AbsoluteLengthOrPercentage,
342// canonical_order = "per grammar",
343// )]
344// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
345// #[cfg_attr(
346// feature = "css_feature_data",
347// derive(ToCSSFeature),
348// css_feature("css.properties.translate")
349// )]
350// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
351// #[derive(csskit_derives::NodeWithMetadata)]
352// pub struct TranslateStyleValue;