Skip to main content

css_ast/values/transforms/
mod.rs

1// AUTO-GENERATED from w3c/csswg-drafts
2// Commit: https://github.com/w3c/csswg-drafts/commit/ddbceaa3cee88f134d557c3051c26fcb5554a535
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/// <position-one> | <position-two> <length>?
239/// ```
240///
241/// https://drafts.csswg.org/css-transforms-2/#transform-origin
242#[syntax(" <position-one> | <position-two> <length>? ")]
243#[derive(
244	Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
245)]
246#[declaration_metadata(
247    initial = "50% 50%",
248    applies_to = Unknown,
249    animation_type = ByComputedValue,
250    percentages = ReferenceBox,
251    property_group = Transforms,
252    computed_value_type = Unknown,
253    canonical_order = "per grammar",
254)]
255#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
256#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transform-origin"))]
257#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
258#[derive(csskit_derives::NodeWithMetadata)]
259pub enum TransformOriginStyleValue {}
260
261/// Represents the style value for `transform-style` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#transform-style).
262///
263/// The transform CSS property and its 3D transform functions allow rotations and other transforms in three dimensions, including perspective transforms.
264///
265/// The grammar is defined as:
266///
267/// ```text,ignore
268/// flat | preserve-3d
269/// ```
270///
271/// https://drafts.csswg.org/css-transforms-2/#transform-style
272#[syntax(" flat | preserve-3d ")]
273#[derive(
274	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
275)]
276#[declaration_metadata(
277    initial = "flat",
278    applies_to = Unknown,
279    animation_type = Discrete,
280    property_group = Transforms,
281    computed_value_type = Unknown,
282    canonical_order = "per grammar",
283)]
284#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
285#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transform-style"))]
286#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
287#[derive(csskit_derives::NodeWithMetadata)]
288pub enum TransformStyleStyleValue {}
289
290/// Represents the style value for `translate` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#translate).
291///
292/// The translate, rotate, and scale CSS properties apply single transformations independently, as opposed to applying multiple transformations with the transform CSS property.
293///
294/// The grammar is defined as:
295///
296/// ```text,ignore
297/// none | <length-percentage> [ <length-percentage> <length>? ]?
298/// ```
299///
300/// https://drafts.csswg.org/css-transforms-2/#translate
301#[syntax(" none | <length-percentage> [ <length-percentage> <length>? ]? ")]
302#[derive(
303	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
304)]
305#[declaration_metadata(
306    initial = "none",
307    applies_to = Unknown,
308    animation_type = ByComputedValue,
309    percentages = ReferenceBox,
310    property_group = Transforms,
311    computed_value_type = AbsoluteLengthOrPercentage,
312    canonical_order = "per grammar",
313)]
314#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
315#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.translate"))]
316#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
317#[derive(csskit_derives::NodeWithMetadata)]
318pub struct TranslateStyleValue;