Skip to main content

css_ast/values/flexbox/
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-flexbox-2/
6
7mod impls;
8use super::prelude::*;
9use impls::*;
10/// Represents the style value for `flex` as defined in [css-flexbox-2](https://drafts.csswg.org/css-flexbox-2/#flex).
11///
12/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
13///
14/// The grammar is defined as:
15///
16/// ```text,ignore
17/// none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]
18/// ```
19///
20/// https://drafts.csswg.org/css-flexbox-2/#flex
21#[syntax(" none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ] ")]
22#[derive(
23	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
24)]
25#[declaration_metadata(
26    initial = "0 1 auto",
27    applies_to = Unknown,
28    animation_type = ByComputedValue,
29    percentages = Unknown,
30    longhands = FlexBasis|FlexGrow|FlexShrink,
31    property_group = Flexbox,
32    computed_value_type = Unknown,
33    canonical_order = "per grammar",
34)]
35#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
36#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex"))]
37#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
38#[derive(csskit_derives::NodeWithMetadata)]
39pub struct FlexStyleValue;
40
41/// Represents the style value for `flex-basis` as defined in [css-flexbox-2](https://drafts.csswg.org/css-flexbox-2/#flex-basis).
42///
43/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
44///
45/// The grammar is defined as:
46///
47/// ```text,ignore
48/// content | <'width'>
49/// ```
50///
51/// https://drafts.csswg.org/css-flexbox-2/#flex-basis
52#[syntax(" content | <'width'> ")]
53#[derive(
54	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
55)]
56#[declaration_metadata(
57    initial = "auto",
58    applies_to = Unknown,
59    animation_type = ByComputedValue,
60    percentages = FlexContainer,
61    shorthand_group = Flex,
62    property_group = Flexbox,
63    computed_value_type = Unknown,
64    canonical_order = "per grammar",
65)]
66#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
67#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex-basis"))]
68#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
69#[derive(csskit_derives::NodeWithMetadata)]
70pub enum FlexBasisStyleValue {}
71
72/// Represents the style value for `flex-direction` as defined in [css-flexbox-2](https://drafts.csswg.org/css-flexbox-2/#flex-direction).
73///
74/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
75///
76/// The grammar is defined as:
77///
78/// ```text,ignore
79/// row | row-reverse | column | column-reverse
80/// ```
81///
82/// https://drafts.csswg.org/css-flexbox-2/#flex-direction
83#[syntax(" row | row-reverse | column | column-reverse ")]
84#[derive(
85	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
86)]
87#[declaration_metadata(
88    initial = "row",
89    applies_to = Flex,
90    animation_type = Discrete,
91    shorthand_group = FlexFlow,
92    property_group = Flexbox,
93    computed_value_type = Unknown,
94    canonical_order = "per grammar",
95)]
96#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
97#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex-direction"))]
98#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
99#[derive(csskit_derives::NodeWithMetadata)]
100pub enum FlexDirectionStyleValue {}
101
102/// Represents the style value for `flex-flow` as defined in [css-flexbox-2](https://drafts.csswg.org/css-flexbox-2/#flex-flow).
103///
104/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
105///
106/// The grammar is defined as:
107///
108/// ```text,ignore
109/// <'flex-direction'> || <'flex-wrap'>
110/// ```
111///
112/// https://drafts.csswg.org/css-flexbox-2/#flex-flow
113#[syntax(" <'flex-direction'> || <'flex-wrap'> ")]
114#[derive(
115	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
116)]
117#[declaration_metadata(
118    initial = "see individual properties",
119    inherits = Unknown,
120    applies_to = Unknown,
121    animation_type = Unknown,
122    percentages = Unknown,
123    longhands = FlexDirection|FlexWrap,
124    property_group = Flexbox,
125    computed_value_type = Unknown,
126    canonical_order = "per grammar",
127)]
128#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
129#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex-flow"))]
130#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
131#[derive(csskit_derives::NodeWithMetadata)]
132pub struct FlexFlowStyleValue;
133
134/// Represents the style value for `flex-grow` as defined in [css-flexbox-2](https://drafts.csswg.org/css-flexbox-2/#flex-grow).
135///
136/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
137///
138/// The grammar is defined as:
139///
140/// ```text,ignore
141/// <number [0,∞]>
142/// ```
143///
144/// https://drafts.csswg.org/css-flexbox-2/#flex-grow
145#[syntax(" <number [0,∞]> ")]
146#[derive(
147	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
148)]
149#[declaration_metadata(
150    initial = "0",
151    applies_to = Unknown,
152    animation_type = ByComputedValue,
153    shorthand_group = Flex,
154    property_group = Flexbox,
155    computed_value_type = Unknown,
156    canonical_order = "per grammar",
157)]
158#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
159#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex-grow"))]
160#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
161#[derive(csskit_derives::NodeWithMetadata)]
162pub struct FlexGrowStyleValue;
163
164/// Represents the style value for `flex-line-count` as defined in [css-flexbox-2](https://drafts.csswg.org/css-flexbox-2/#flex-line-count).
165///
166/// The grammar is defined as:
167///
168/// ```text,ignore
169/// <integer [1,∞]>
170/// ```
171///
172/// https://drafts.csswg.org/css-flexbox-2/#flex-line-count
173#[syntax(" <integer [1,∞]> ")]
174#[derive(
175	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
176)]
177#[declaration_metadata(
178    initial = "1",
179    applies_to = Unknown,
180    animation_type = Unknown,
181    property_group = Flexbox,
182    computed_value_type = Unknown,
183    canonical_order = "per grammar",
184)]
185#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
186#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex-line-count"))]
187#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
188#[derive(csskit_derives::NodeWithMetadata)]
189pub struct FlexLineCountStyleValue;
190
191/// Represents the style value for `flex-shrink` as defined in [css-flexbox-2](https://drafts.csswg.org/css-flexbox-2/#flex-shrink).
192///
193/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
194///
195/// The grammar is defined as:
196///
197/// ```text,ignore
198/// <number [0,∞]>
199/// ```
200///
201/// https://drafts.csswg.org/css-flexbox-2/#flex-shrink
202#[syntax(" <number [0,∞]> ")]
203#[derive(
204	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
205)]
206#[declaration_metadata(
207    initial = "1",
208    applies_to = Unknown,
209    animation_type = Number,
210    shorthand_group = Flex,
211    property_group = Flexbox,
212    computed_value_type = AsSpecified,
213    canonical_order = "per grammar",
214)]
215#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
216#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex-shrink"))]
217#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
218#[derive(csskit_derives::NodeWithMetadata)]
219pub struct FlexShrinkStyleValue;
220
221/// Represents the style value for `flex-wrap` as defined in [css-flexbox-2](https://drafts.csswg.org/css-flexbox-2/#flex-wrap).
222///
223/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
224///
225/// The grammar is defined as:
226///
227/// ```text,ignore
228/// nowrap | [ wrap | wrap-reverse ] || balance
229/// ```
230///
231/// https://drafts.csswg.org/css-flexbox-2/#flex-wrap
232#[syntax(" nowrap | [ wrap | wrap-reverse ] || balance ")]
233#[derive(
234	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
235)]
236#[declaration_metadata(
237    initial = "nowrap",
238    applies_to = Flex,
239    animation_type = Discrete,
240    shorthand_group = FlexFlow,
241    property_group = Flexbox,
242    computed_value_type = Unknown,
243    canonical_order = "per grammar",
244)]
245#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
246#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex-wrap"))]
247#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
248#[derive(csskit_derives::NodeWithMetadata)]
249pub enum FlexWrapStyleValue {}