Skip to main content

css_ast/values/sizing/
mod.rs

1// AUTO-GENERATED from w3c/csswg-drafts
2// Commit: https://github.com/w3c/csswg-drafts/commit/e8f0279ce0beff5d70e59fa4165a668e1527fff6
3// Do not edit this file directly.
4#![allow(warnings)]
5//! https://drafts.csswg.org/css-sizing-4/
6
7mod impls;
8use super::prelude::*;
9use impls::*;
10/// Represents the style value for `aspect-ratio` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#aspect-ratio).
11///
12/// The aspect-ratio CSS property controls the width-to-height ratio of elements. For <img> and <video> elements, the width and height attributes used together with height: auto control the aspect ratio while the image/video is loading.
13///
14/// The grammar is defined as:
15///
16/// ```text,ignore
17/// auto || <ratio>
18/// ```
19///
20/// https://drafts.csswg.org/css-sizing-4/#aspect-ratio
21#[syntax(" auto || <ratio> ")]
22#[derive(
23	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
24)]
25#[declaration_metadata(
26    initial = "auto",
27    applies_to = Unknown,
28    animation_type = ByComputedValue,
29    property_group = Sizing,
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.aspect-ratio"))]
35#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
36#[derive(csskit_derives::NodeWithMetadata)]
37pub struct AspectRatioStyleValue;
38
39/// Represents the style value for `box-sizing` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#box-sizing).
40///
41/// The box-sizing CSS property sets whether an element's width and height are calculated based on the content-box, which does not count the size of borders or padding, or border-box, which does count them.
42///
43/// The grammar is defined as:
44///
45/// ```text,ignore
46/// content-box | border-box
47/// ```
48///
49/// https://drafts.csswg.org/css-sizing-4/#box-sizing
50#[syntax(" content-box | border-box ")]
51#[derive(
52	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
53)]
54#[declaration_metadata(
55    initial = "content-box",
56    applies_to = Unknown,
57    animation_type = Discrete,
58    property_group = Sizing,
59    computed_value_type = Unknown,
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.box-sizing"))]
64#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
65#[derive(csskit_derives::NodeWithMetadata)]
66pub enum BoxSizingStyleValue {}
67
68/// Represents the style value for `contain-intrinsic-block-size` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-block-size).
69///
70/// The contain-intrinsic-size CSS property sets the intrinsic size of an element. When using size containment, the browser will lay out the element as if it had a single child of this size.
71///
72/// The grammar is defined as:
73///
74/// ```text,ignore
75/// auto? [ none | <length [0,∞]> ]
76/// ```
77///
78/// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-block-size
79#[syntax(" auto? [ none | <length [0,∞]> ] ")]
80#[derive(
81	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
82)]
83#[declaration_metadata(
84    initial = "none",
85    applies_to = Unknown,
86    animation_type = ByComputedValue,
87    property_group = Sizing,
88    computed_value_type = AsSpecified,
89    canonical_order = "per grammar",
90    logical_property_group = ContainIntrinsicSize,
91    box_side = BlockStart|BlockEnd,
92)]
93#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
94#[cfg_attr(
95	feature = "css_feature_data",
96	derive(ToCSSFeature),
97	css_feature("css.properties.contain-intrinsic-block-size")
98)]
99#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
100#[derive(csskit_derives::NodeWithMetadata)]
101pub struct ContainIntrinsicBlockSizeStyleValue;
102
103/// Represents the style value for `contain-intrinsic-height` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-height).
104///
105/// The contain-intrinsic-size CSS property sets the intrinsic size of an element. When using size containment, the browser will lay out the element as if it had a single child of this size.
106///
107/// The grammar is defined as:
108///
109/// ```text,ignore
110/// auto? [ none | <length [0,∞]> ]
111/// ```
112///
113/// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-height
114#[syntax(" auto? [ none | <length [0,∞]> ] ")]
115#[derive(
116	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
117)]
118#[declaration_metadata(
119    initial = "none",
120    applies_to = Unknown,
121    animation_type = ByComputedValue,
122    shorthand_group = ContainIntrinsicSize,
123    property_group = Sizing,
124    computed_value_type = AsSpecified,
125    canonical_order = "per grammar",
126    logical_property_group = ContainIntrinsicSize,
127)]
128#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
129#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.contain-intrinsic-height"))]
130#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
131#[derive(csskit_derives::NodeWithMetadata)]
132pub struct ContainIntrinsicHeightStyleValue;
133
134/// Represents the style value for `contain-intrinsic-inline-size` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-inline-size).
135///
136/// The contain-intrinsic-size CSS property sets the intrinsic size of an element. When using size containment, the browser will lay out the element as if it had a single child of this size.
137///
138/// The grammar is defined as:
139///
140/// ```text,ignore
141/// auto? [ none | <length [0,∞]> ]
142/// ```
143///
144/// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-inline-size
145#[syntax(" auto? [ none | <length [0,∞]> ] ")]
146#[derive(
147	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
148)]
149#[declaration_metadata(
150    initial = "none",
151    applies_to = Unknown,
152    animation_type = ByComputedValue,
153    property_group = Sizing,
154    computed_value_type = AsSpecified,
155    canonical_order = "per grammar",
156    logical_property_group = ContainIntrinsicSize,
157    box_side = InlineStart|InlineEnd,
158)]
159#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
160#[cfg_attr(
161	feature = "css_feature_data",
162	derive(ToCSSFeature),
163	css_feature("css.properties.contain-intrinsic-inline-size")
164)]
165#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
166#[derive(csskit_derives::NodeWithMetadata)]
167pub struct ContainIntrinsicInlineSizeStyleValue;
168
169/// Represents the style value for `contain-intrinsic-size` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-size).
170///
171/// The contain-intrinsic-size CSS property sets the intrinsic size of an element. When using size containment, the browser will lay out the element as if it had a single child of this size.
172///
173/// The grammar is defined as:
174///
175/// ```text,ignore
176/// [ auto? [ none | <length [0,∞]> ] ]{1,2}
177/// ```
178///
179/// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-size
180#[syntax(" [ auto? [ none | <length [0,∞]> ] ]{1,2} ")]
181#[derive(
182	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
183)]
184#[declaration_metadata(
185    initial = "see individual properties",
186    inherits = Unknown,
187    applies_to = Unknown,
188    animation_type = Unknown,
189    percentages = Unknown,
190    longhands = ContainIntrinsicHeight|ContainIntrinsicWidth,
191    property_group = Sizing,
192    computed_value_type = Unknown,
193    canonical_order = "per grammar",
194)]
195#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
196#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.contain-intrinsic-size"))]
197#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
198#[derive(csskit_derives::NodeWithMetadata)]
199pub struct ContainIntrinsicSizeStyleValue;
200
201/// Represents the style value for `contain-intrinsic-width` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-width).
202///
203/// The contain-intrinsic-size CSS property sets the intrinsic size of an element. When using size containment, the browser will lay out the element as if it had a single child of this size.
204///
205/// The grammar is defined as:
206///
207/// ```text,ignore
208/// auto? [ none | <length [0,∞]> ]
209/// ```
210///
211/// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-width
212#[syntax(" auto? [ none | <length [0,∞]> ] ")]
213#[derive(
214	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
215)]
216#[declaration_metadata(
217    initial = "none",
218    applies_to = Unknown,
219    animation_type = ByComputedValue,
220    shorthand_group = ContainIntrinsicSize,
221    property_group = Sizing,
222    computed_value_type = AsSpecified,
223    canonical_order = "per grammar",
224    logical_property_group = ContainIntrinsicSize,
225)]
226#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
227#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.contain-intrinsic-width"))]
228#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
229#[derive(csskit_derives::NodeWithMetadata)]
230pub struct ContainIntrinsicWidthStyleValue;
231
232/// Represents the style value for `frame-sizing` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#frame-sizing).
233///
234/// The grammar is defined as:
235///
236/// ```text,ignore
237/// auto | content-width | content-height | content-block-size | content-inline-size
238/// ```
239///
240/// https://drafts.csswg.org/css-sizing-4/#frame-sizing
241#[syntax(" auto | content-width | content-height | content-block-size | content-inline-size ")]
242#[derive(
243	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
244)]
245#[declaration_metadata(
246    initial = "auto",
247    applies_to = Unknown,
248    animation_type = Discrete,
249    property_group = Sizing,
250    computed_value_type = AsSpecified,
251    canonical_order = "per grammar",
252)]
253#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
254#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.frame-sizing"))]
255#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
256#[derive(csskit_derives::NodeWithMetadata)]
257pub enum FrameSizingStyleValue {}
258
259/// Represents the style value for `height` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#height).
260///
261/// The width and height CSS properties set the preferred physical size of an element.
262///
263/// The grammar is defined as:
264///
265/// ```text,ignore
266/// auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
267/// ```
268///
269/// https://drafts.csswg.org/css-sizing-4/#height
270#[syntax(
271	" auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
272)]
273#[derive(
274	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
275)]
276#[declaration_metadata(
277    initial = "auto",
278    applies_to = Unknown,
279    animation_type = ByComputedValue,
280    percentages = ContainingBlock,
281    property_group = Sizing,
282    computed_value_type = AsSpecified,
283    canonical_order = "per grammar",
284    logical_property_group = Size,
285    box_portion = Size,
286)]
287#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
288#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.height"))]
289#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
290#[derive(csskit_derives::NodeWithMetadata)]
291pub enum HeightStyleValue {}
292
293/// Represents the style value for `max-height` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#max-height).
294///
295/// The min-width, min-height, max-width, and max-height CSS properties set the minimum and maximum size of an element.
296///
297/// The grammar is defined as:
298///
299/// ```text,ignore
300/// none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
301/// ```
302///
303/// https://drafts.csswg.org/css-sizing-4/#max-height
304#[syntax(
305	" none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
306)]
307#[derive(
308	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
309)]
310#[declaration_metadata(
311    initial = "none",
312    applies_to = Unknown,
313    animation_type = ByComputedValue,
314    percentages = ContainingBlock,
315    property_group = Sizing,
316    computed_value_type = AsSpecified,
317    canonical_order = "per grammar",
318    logical_property_group = MaxSize,
319    box_portion = Size,
320)]
321#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
322#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.max-height"))]
323#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
324#[derive(csskit_derives::NodeWithMetadata)]
325pub enum MaxHeightStyleValue {}
326
327/// Represents the style value for `max-width` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#max-width).
328///
329/// The min-width, min-height, max-width, and max-height CSS properties set the minimum and maximum size of an element.
330///
331/// The grammar is defined as:
332///
333/// ```text,ignore
334/// none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
335/// ```
336///
337/// https://drafts.csswg.org/css-sizing-4/#max-width
338#[syntax(
339	" none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
340)]
341#[derive(
342	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
343)]
344#[declaration_metadata(
345    initial = "none",
346    applies_to = Unknown,
347    animation_type = ByComputedValue,
348    percentages = ContainingBlock,
349    property_group = Sizing,
350    computed_value_type = AsSpecified,
351    canonical_order = "per grammar",
352    logical_property_group = MaxSize,
353    box_portion = Size,
354)]
355#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
356#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.max-width"))]
357#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
358#[derive(csskit_derives::NodeWithMetadata)]
359pub enum MaxWidthStyleValue {}
360
361/// Represents the style value for `min-height` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#min-height).
362///
363/// The min-width, min-height, max-width, and max-height CSS properties set the minimum and maximum size of an element.
364///
365/// The grammar is defined as:
366///
367/// ```text,ignore
368/// auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
369/// ```
370///
371/// https://drafts.csswg.org/css-sizing-4/#min-height
372#[syntax(
373	" auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
374)]
375#[derive(
376	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
377)]
378#[declaration_metadata(
379    initial = "auto",
380    applies_to = Unknown,
381    animation_type = ByComputedValue,
382    percentages = ContainingBlock,
383    property_group = Sizing,
384    computed_value_type = AsSpecified,
385    canonical_order = "per grammar",
386    logical_property_group = MinSize,
387    box_portion = Size,
388)]
389#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
390#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.min-height"))]
391#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
392#[derive(csskit_derives::NodeWithMetadata)]
393pub enum MinHeightStyleValue {}
394
395/// Represents the style value for `min-intrinsic-sizing` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#min-intrinsic-sizing).
396///
397/// The grammar is defined as:
398///
399/// ```text,ignore
400/// legacy | zero-if-scroll || zero-if-extrinsic
401/// ```
402///
403/// https://drafts.csswg.org/css-sizing-4/#min-intrinsic-sizing
404#[syntax(" legacy | zero-if-scroll || zero-if-extrinsic ")]
405#[derive(
406	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
407)]
408#[declaration_metadata(
409    initial = "legacy",
410    applies_to = Unknown,
411    animation_type = Discrete,
412    property_group = Sizing,
413    computed_value_type = AsSpecified,
414    canonical_order = "per grammar",
415)]
416#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
417#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.min-intrinsic-sizing"))]
418#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
419#[derive(csskit_derives::NodeWithMetadata)]
420pub enum MinIntrinsicSizingStyleValue {}
421
422/// Represents the style value for `min-width` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#min-width).
423///
424/// The min-width, min-height, max-width, and max-height CSS properties set the minimum and maximum size of an element.
425///
426/// The grammar is defined as:
427///
428/// ```text,ignore
429/// auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
430/// ```
431///
432/// https://drafts.csswg.org/css-sizing-4/#min-width
433#[syntax(
434	" auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
435)]
436#[derive(
437	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
438)]
439#[declaration_metadata(
440    initial = "auto",
441    applies_to = Unknown,
442    animation_type = ByComputedValue,
443    percentages = ContainingBlock,
444    property_group = Sizing,
445    computed_value_type = AsSpecified,
446    canonical_order = "per grammar",
447    logical_property_group = MinSize,
448    box_portion = Size,
449)]
450#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
451#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.min-width"))]
452#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
453#[derive(csskit_derives::NodeWithMetadata)]
454pub enum MinWidthStyleValue {}
455
456/// Represents the style value for `width` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#width).
457///
458/// The width and height CSS properties set the preferred physical size of an element.
459///
460/// The grammar is defined as:
461///
462/// ```text,ignore
463/// auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
464/// ```
465///
466/// https://drafts.csswg.org/css-sizing-4/#width
467#[syntax(
468	" auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
469)]
470#[derive(
471	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
472)]
473#[declaration_metadata(
474    initial = "auto",
475    applies_to = Unknown,
476    animation_type = ByComputedValue,
477    percentages = ContainingBlock,
478    property_group = Sizing,
479    computed_value_type = AsSpecified,
480    canonical_order = "per grammar",
481    logical_property_group = Size,
482    box_portion = Size,
483)]
484#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
485#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.width"))]
486#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
487#[derive(csskit_derives::NodeWithMetadata)]
488pub enum WidthStyleValue {}