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