css_ast/values/sizing/
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-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 | from-element ]? [ none | <length [0,∞]> ]
76// /// ```
77// ///
78// /// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-block-size
79// #[syntax(" [ auto | from-element ]? [ none | <length [0,∞]> ] ")]
80// #[derive(
81//     Parse,
82//     Peek,
83//     ToSpan,
84//     ToCursors,
85//     DeclarationMetadata,
86//     SemanticEq,
87//     Debug,
88//     Clone,
89//     PartialEq,
90//     Eq,
91//     PartialOrd,
92//     Ord,
93//     Hash,
94// )]
95// #[declaration_metadata(
96//     initial = "none",
97//     applies_to = Unknown,
98//     animation_type = ByComputedValue,
99//     property_group = Sizing,
100//     computed_value_type = AsSpecified,
101//     canonical_order = "per grammar",
102//     logical_property_group = ContainIntrinsicSize,
103//     box_side = BlockStart|BlockEnd,
104// )]
105// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
106// #[cfg_attr(
107//     feature = "css_feature_data",
108//     derive(ToCSSFeature),
109//     css_feature("css.properties.contain-intrinsic-block-size")
110// )]
111// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
112// #[derive(csskit_derives::NodeWithMetadata)]
113// pub struct ContainIntrinsicBlockSizeStyleValue;
114
115// /// Represents the style value for `contain-intrinsic-height` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-height).
116// ///
117// /// 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.
118// ///
119// /// The grammar is defined as:
120// ///
121// /// ```text,ignore
122// /// [ auto | from-element ]? [ none | <length [0,∞]> ]
123// /// ```
124// ///
125// /// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-height
126// #[syntax(" [ auto | from-element ]? [ none | <length [0,∞]> ] ")]
127// #[derive(
128//     Parse,
129//     Peek,
130//     ToSpan,
131//     ToCursors,
132//     DeclarationMetadata,
133//     SemanticEq,
134//     Debug,
135//     Clone,
136//     PartialEq,
137//     Eq,
138//     PartialOrd,
139//     Ord,
140//     Hash,
141// )]
142// #[declaration_metadata(
143//     initial = "none",
144//     applies_to = Unknown,
145//     animation_type = ByComputedValue,
146//     shorthand_group = ContainIntrinsicSize,
147//     property_group = Sizing,
148//     computed_value_type = AsSpecified,
149//     canonical_order = "per grammar",
150//     logical_property_group = ContainIntrinsicSize,
151// )]
152// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
153// #[cfg_attr(
154//     feature = "css_feature_data",
155//     derive(ToCSSFeature),
156//     css_feature("css.properties.contain-intrinsic-height")
157// )]
158// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
159// #[derive(csskit_derives::NodeWithMetadata)]
160// pub struct ContainIntrinsicHeightStyleValue;
161
162// /// 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).
163// ///
164// /// 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.
165// ///
166// /// The grammar is defined as:
167// ///
168// /// ```text,ignore
169// /// [ auto | from-element ]? [ none | <length [0,∞]> ]
170// /// ```
171// ///
172// /// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-inline-size
173// #[syntax(" [ auto | from-element ]? [ none | <length [0,∞]> ] ")]
174// #[derive(
175//     Parse,
176//     Peek,
177//     ToSpan,
178//     ToCursors,
179//     DeclarationMetadata,
180//     SemanticEq,
181//     Debug,
182//     Clone,
183//     PartialEq,
184//     Eq,
185//     PartialOrd,
186//     Ord,
187//     Hash,
188// )]
189// #[declaration_metadata(
190//     initial = "none",
191//     applies_to = Unknown,
192//     animation_type = ByComputedValue,
193//     property_group = Sizing,
194//     computed_value_type = AsSpecified,
195//     canonical_order = "per grammar",
196//     logical_property_group = ContainIntrinsicSize,
197//     box_side = InlineStart|InlineEnd,
198// )]
199// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
200// #[cfg_attr(
201//     feature = "css_feature_data",
202//     derive(ToCSSFeature),
203//     css_feature("css.properties.contain-intrinsic-inline-size")
204// )]
205// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
206// #[derive(csskit_derives::NodeWithMetadata)]
207// pub struct ContainIntrinsicInlineSizeStyleValue;
208
209// /// Represents the style value for `contain-intrinsic-size` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-size).
210// ///
211// /// 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.
212// ///
213// /// The grammar is defined as:
214// ///
215// /// ```text,ignore
216// /// [ [ auto | from-element ]? [ none | <length [0,∞]> ] ]{1,2}
217// /// ```
218// ///
219// /// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-size
220// #[syntax(" [ [ auto | from-element ]? [ none | <length [0,∞]> ] ]{1,2} ")]
221// #[derive(
222//     Parse,
223//     Peek,
224//     ToSpan,
225//     ToCursors,
226//     DeclarationMetadata,
227//     SemanticEq,
228//     Debug,
229//     Clone,
230//     PartialEq,
231//     Eq,
232//     PartialOrd,
233//     Ord,
234//     Hash,
235// )]
236// #[declaration_metadata(
237//     initial = "see individual properties",
238//     inherits = Unknown,
239//     applies_to = Unknown,
240//     animation_type = Unknown,
241//     percentages = Unknown,
242//     longhands = ContainIntrinsicHeight|ContainIntrinsicWidth,
243//     property_group = Sizing,
244//     computed_value_type = Unknown,
245//     canonical_order = "per grammar",
246// )]
247// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
248// #[cfg_attr(
249//     feature = "css_feature_data",
250//     derive(ToCSSFeature),
251//     css_feature("css.properties.contain-intrinsic-size")
252// )]
253// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
254// #[derive(csskit_derives::NodeWithMetadata)]
255// pub struct ContainIntrinsicSizeStyleValue;
256
257// /// Represents the style value for `contain-intrinsic-width` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-width).
258// ///
259// /// 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.
260// ///
261// /// The grammar is defined as:
262// ///
263// /// ```text,ignore
264// /// [ auto | from-element ]? [ none | <length [0,∞]> ]
265// /// ```
266// ///
267// /// https://drafts.csswg.org/css-sizing-4/#contain-intrinsic-width
268// #[syntax(" [ auto | from-element ]? [ none | <length [0,∞]> ] ")]
269// #[derive(
270//     Parse,
271//     Peek,
272//     ToSpan,
273//     ToCursors,
274//     DeclarationMetadata,
275//     SemanticEq,
276//     Debug,
277//     Clone,
278//     PartialEq,
279//     Eq,
280//     PartialOrd,
281//     Ord,
282//     Hash,
283// )]
284// #[declaration_metadata(
285//     initial = "none",
286//     applies_to = Unknown,
287//     animation_type = ByComputedValue,
288//     shorthand_group = ContainIntrinsicSize,
289//     property_group = Sizing,
290//     computed_value_type = AsSpecified,
291//     canonical_order = "per grammar",
292//     logical_property_group = ContainIntrinsicSize,
293// )]
294// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
295// #[cfg_attr(
296//     feature = "css_feature_data",
297//     derive(ToCSSFeature),
298//     css_feature("css.properties.contain-intrinsic-width")
299// )]
300// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
301// #[derive(csskit_derives::NodeWithMetadata)]
302// pub struct ContainIntrinsicWidthStyleValue;
303
304/// Represents the style value for `height` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#height).
305///
306/// The width and height CSS properties set the preferred physical size of an element.
307///
308/// The grammar is defined as:
309///
310/// ```text,ignore
311/// auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
312/// ```
313///
314/// https://drafts.csswg.org/css-sizing-4/#height
315#[syntax(
316	" auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
317)]
318#[derive(
319	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
320)]
321#[declaration_metadata(
322    initial = "auto",
323    applies_to = Unknown,
324    animation_type = ByComputedValue,
325    percentages = ContainingBlock,
326    property_group = Sizing,
327    computed_value_type = AsSpecified,
328    canonical_order = "per grammar",
329    logical_property_group = Size,
330    box_portion = Size,
331)]
332#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
333#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.height"))]
334#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
335#[derive(csskit_derives::NodeWithMetadata)]
336pub enum HeightStyleValue {}
337
338/// Represents the style value for `max-height` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#max-height).
339///
340/// The min-width, min-height, max-width, and max-height CSS properties set the minimum and maximum size of an element.
341///
342/// The grammar is defined as:
343///
344/// ```text,ignore
345/// none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
346/// ```
347///
348/// https://drafts.csswg.org/css-sizing-4/#max-height
349#[syntax(
350	" none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
351)]
352#[derive(
353	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
354)]
355#[declaration_metadata(
356    initial = "none",
357    applies_to = Unknown,
358    animation_type = ByComputedValue,
359    percentages = ContainingBlock,
360    property_group = Sizing,
361    computed_value_type = AsSpecified,
362    canonical_order = "per grammar",
363    logical_property_group = MaxSize,
364    box_portion = Size,
365)]
366#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
367#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.max-height"))]
368#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
369#[derive(csskit_derives::NodeWithMetadata)]
370pub enum MaxHeightStyleValue {}
371
372/// Represents the style value for `max-width` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#max-width).
373///
374/// The min-width, min-height, max-width, and max-height CSS properties set the minimum and maximum size of an element.
375///
376/// The grammar is defined as:
377///
378/// ```text,ignore
379/// none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
380/// ```
381///
382/// https://drafts.csswg.org/css-sizing-4/#max-width
383#[syntax(
384	" none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
385)]
386#[derive(
387	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
388)]
389#[declaration_metadata(
390    initial = "none",
391    applies_to = Unknown,
392    animation_type = ByComputedValue,
393    percentages = ContainingBlock,
394    property_group = Sizing,
395    computed_value_type = AsSpecified,
396    canonical_order = "per grammar",
397    logical_property_group = MaxSize,
398    box_portion = Size,
399)]
400#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
401#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.max-width"))]
402#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
403#[derive(csskit_derives::NodeWithMetadata)]
404pub enum MaxWidthStyleValue {}
405
406/// Represents the style value for `min-height` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#min-height).
407///
408/// The min-width, min-height, max-width, and max-height CSS properties set the minimum and maximum size of an element.
409///
410/// The grammar is defined as:
411///
412/// ```text,ignore
413/// auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
414/// ```
415///
416/// https://drafts.csswg.org/css-sizing-4/#min-height
417#[syntax(
418	" auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
419)]
420#[derive(
421	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
422)]
423#[declaration_metadata(
424    initial = "auto",
425    applies_to = Unknown,
426    animation_type = ByComputedValue,
427    percentages = ContainingBlock,
428    property_group = Sizing,
429    computed_value_type = AsSpecified,
430    canonical_order = "per grammar",
431    logical_property_group = MinSize,
432    box_portion = Size,
433)]
434#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
435#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.min-height"))]
436#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
437#[derive(csskit_derives::NodeWithMetadata)]
438pub enum MinHeightStyleValue {}
439
440// /// Represents the style value for `min-intrinsic-sizing` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#min-intrinsic-sizing).
441// ///
442// /// The grammar is defined as:
443// ///
444// /// ```text,ignore
445// /// legacy | zero-if-scroll || zero-if-extrinsic
446// /// ```
447// ///
448// /// https://drafts.csswg.org/css-sizing-4/#min-intrinsic-sizing
449// #[syntax(" legacy | zero-if-scroll || zero-if-extrinsic ")]
450// #[derive(
451//     Parse,
452//     Peek,
453//     ToSpan,
454//     ToCursors,
455//     DeclarationMetadata,
456//     SemanticEq,
457//     Debug,
458//     Clone,
459//     PartialEq,
460//     Eq,
461//     PartialOrd,
462//     Ord,
463//     Hash,
464// )]
465// #[declaration_metadata(
466//     initial = "legacy",
467//     applies_to = Unknown,
468//     animation_type = Discrete,
469//     property_group = Sizing,
470//     computed_value_type = AsSpecified,
471//     canonical_order = "per grammar",
472// )]
473// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
474// #[cfg_attr(
475//     feature = "css_feature_data",
476//     derive(ToCSSFeature),
477//     css_feature("css.properties.min-intrinsic-sizing")
478// )]
479// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
480// #[derive(csskit_derives::NodeWithMetadata)]
481// pub enum MinIntrinsicSizingStyleValue {}
482
483/// Represents the style value for `min-width` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#min-width).
484///
485/// The min-width, min-height, max-width, and max-height CSS properties set the minimum and maximum size of an element.
486///
487/// The grammar is defined as:
488///
489/// ```text,ignore
490/// auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
491/// ```
492///
493/// https://drafts.csswg.org/css-sizing-4/#min-width
494#[syntax(
495	" auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
496)]
497#[derive(
498	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
499)]
500#[declaration_metadata(
501    initial = "auto",
502    applies_to = Unknown,
503    animation_type = ByComputedValue,
504    percentages = ContainingBlock,
505    property_group = Sizing,
506    computed_value_type = AsSpecified,
507    canonical_order = "per grammar",
508    logical_property_group = MinSize,
509    box_portion = Size,
510)]
511#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
512#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.min-width"))]
513#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
514#[derive(csskit_derives::NodeWithMetadata)]
515pub enum MinWidthStyleValue {}
516
517/// Represents the style value for `width` as defined in [css-sizing-4](https://drafts.csswg.org/css-sizing-4/#width).
518///
519/// The width and height CSS properties set the preferred physical size of an element.
520///
521/// The grammar is defined as:
522///
523/// ```text,ignore
524/// auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain
525/// ```
526///
527/// https://drafts.csswg.org/css-sizing-4/#width
528#[syntax(
529	" auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain "
530)]
531#[derive(
532	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
533)]
534#[declaration_metadata(
535    initial = "auto",
536    applies_to = Unknown,
537    animation_type = ByComputedValue,
538    percentages = ContainingBlock,
539    property_group = Sizing,
540    computed_value_type = AsSpecified,
541    canonical_order = "per grammar",
542    logical_property_group = Size,
543    box_portion = Size,
544)]
545#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
546#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.width"))]
547#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
548#[derive(csskit_derives::NodeWithMetadata)]
549pub enum WidthStyleValue {}