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/27fd597de31a8c43234f99f58983e4af3d1f9282
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<'a> {}
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<'a>;
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<'a>;
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	Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
112)]
113#[declaration_metadata(
114    initial = "none",
115    applies_to = Unknown,
116    animation_type = Unknown,
117    property_group = Transforms,
118    computed_value_type = Unknown,
119    canonical_order = "per grammar",
120)]
121#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
122#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.rotate"))]
123#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
124#[derive(csskit_derives::NodeWithMetadata)]
125pub enum RotateStyleValue<'a> {}
126
127/// Represents the style value for `scale` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#scale).
128///
129/// The translate, rotate, and scale CSS properties apply single transformations independently, as opposed to applying multiple transformations with the transform CSS property.
130///
131/// The grammar is defined as:
132///
133/// ```text,ignore
134/// none | [ <number> | <percentage> ]{1,3}
135/// ```
136///
137/// https://drafts.csswg.org/css-transforms-2/#scale
138#[syntax(" none | [ <number> | <percentage> ]{1,3} ")]
139#[derive(
140	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
141)]
142#[declaration_metadata(
143    initial = "none",
144    applies_to = Unknown,
145    animation_type = ByComputedValue,
146    property_group = Transforms,
147    computed_value_type = Unknown,
148    canonical_order = "per grammar",
149)]
150#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
151#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.scale"))]
152#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
153#[derive(csskit_derives::NodeWithMetadata)]
154pub struct ScaleStyleValue<'a>;
155
156/// Represents the style value for `transform` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#transform).
157///
158/// 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.
159///
160/// The grammar is defined as:
161///
162/// ```text,ignore
163/// none | <transform-list>
164/// ```
165///
166/// https://drafts.csswg.org/css-transforms-2/#transform
167#[syntax(" none | <transform-list> ")]
168#[derive(
169	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
170)]
171#[declaration_metadata(
172    initial = "none",
173    applies_to = Unknown,
174    animation_type = TransformList,
175    percentages = ReferenceBox,
176    property_group = Transforms,
177    computed_value_type = AsSpecified,
178    canonical_order = "per grammar",
179)]
180#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
181#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transform"))]
182#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
183#[derive(csskit_derives::NodeWithMetadata)]
184pub struct TransformStyleValue<'a>;
185
186/// Represents the style value for `transform-box` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#transform-box).
187///
188/// The transform-box CSS property sets the position and dimensions of the reference box relative to which an element's transformations are calculated.
189///
190/// The grammar is defined as:
191///
192/// ```text,ignore
193/// content-box | border-box | fill-box | stroke-box | view-box
194/// ```
195///
196/// https://drafts.csswg.org/css-transforms-2/#transform-box
197#[syntax(" content-box | border-box | fill-box | stroke-box | view-box ")]
198#[derive(
199	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
200)]
201#[declaration_metadata(
202    initial = "view-box",
203    applies_to = Unknown,
204    animation_type = Discrete,
205    property_group = Transforms,
206    computed_value_type = Unknown,
207    canonical_order = "per grammar",
208)]
209#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
210#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transform-box"))]
211#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
212#[derive(csskit_derives::NodeWithMetadata)]
213pub enum TransformBoxStyleValue<'a> {}
214
215/// Represents the style value for `transform-origin` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#transform-origin).
216///
217/// 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.
218///
219/// The grammar is defined as:
220///
221/// ```text,ignore
222/// <position-one> | <position-two> <length>?
223/// ```
224///
225/// https://drafts.csswg.org/css-transforms-2/#transform-origin
226#[syntax(" <position-one> | <position-two> <length>? ")]
227#[derive(
228	Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
229)]
230#[declaration_metadata(
231    initial = "50% 50%",
232    applies_to = Unknown,
233    animation_type = ByComputedValue,
234    percentages = ReferenceBox,
235    property_group = Transforms,
236    computed_value_type = Unknown,
237    canonical_order = "per grammar",
238)]
239#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
240#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transform-origin"))]
241#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
242#[derive(csskit_derives::NodeWithMetadata)]
243pub enum TransformOriginStyleValue<'a> {}
244
245/// Represents the style value for `transform-style` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#transform-style).
246///
247/// The transform CSS property and its 3D transform functions allow rotations and other transforms in three dimensions, including perspective transforms.
248///
249/// The grammar is defined as:
250///
251/// ```text,ignore
252/// flat | preserve-3d
253/// ```
254///
255/// https://drafts.csswg.org/css-transforms-2/#transform-style
256#[syntax(" flat | preserve-3d ")]
257#[derive(
258	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
259)]
260#[declaration_metadata(
261    initial = "flat",
262    applies_to = Unknown,
263    animation_type = Discrete,
264    property_group = Transforms,
265    computed_value_type = Unknown,
266    canonical_order = "per grammar",
267)]
268#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
269#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.transform-style"))]
270#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
271#[derive(csskit_derives::NodeWithMetadata)]
272pub enum TransformStyleStyleValue<'a> {}
273
274/// Represents the style value for `translate` as defined in [css-transforms-2](https://drafts.csswg.org/css-transforms-2/#translate).
275///
276/// The translate, rotate, and scale CSS properties apply single transformations independently, as opposed to applying multiple transformations with the transform CSS property.
277///
278/// The grammar is defined as:
279///
280/// ```text,ignore
281/// none | <length-percentage> [ <length-percentage> <length>? ]?
282/// ```
283///
284/// https://drafts.csswg.org/css-transforms-2/#translate
285#[syntax(" none | <length-percentage> [ <length-percentage> <length>? ]? ")]
286#[derive(
287	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
288)]
289#[declaration_metadata(
290    initial = "none",
291    applies_to = Unknown,
292    animation_type = ByComputedValue,
293    percentages = ReferenceBox,
294    property_group = Transforms,
295    computed_value_type = AbsoluteLengthOrPercentage,
296    canonical_order = "per grammar",
297)]
298#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
299#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.translate"))]
300#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
301#[derive(csskit_derives::NodeWithMetadata)]
302pub struct TranslateStyleValue<'a>;