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