css_ast/values/flexbox/
mod.rs

1// AUTO-GENERATED from w3c/csswg-drafts
2// Commit: https://github.com/w3c/csswg-drafts/commit/58eb9b3f45e73a3e4ae51b253a25fa2a11ad142c
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, 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-1](https://drafts.csswg.org/css-flexbox-1/#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-1/#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-1](https://drafts.csswg.org/css-flexbox-1/#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-1/#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-1](https://drafts.csswg.org/css-flexbox-1/#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-1/#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-1](https://drafts.csswg.org/css-flexbox-1/#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-1/#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-shrink` as defined in [css-flexbox-1](https://drafts.csswg.org/css-flexbox-1/#flex-shrink).
165///
166/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
167///
168/// The grammar is defined as:
169///
170/// ```text,ignore
171/// <number [0,∞]>
172/// ```
173///
174/// https://drafts.csswg.org/css-flexbox-1/#flex-shrink
175#[syntax(" <number [0,∞]> ")]
176#[derive(
177	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
178)]
179#[declaration_metadata(
180    initial = "1",
181    applies_to = Unknown,
182    animation_type = Number,
183    shorthand_group = Flex,
184    property_group = Flexbox,
185    computed_value_type = AsSpecified,
186    canonical_order = "per grammar",
187)]
188#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
189#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex-shrink"))]
190#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
191#[derive(csskit_derives::NodeWithMetadata)]
192pub struct FlexShrinkStyleValue;
193
194/// Represents the style value for `flex-wrap` as defined in [css-flexbox-1](https://drafts.csswg.org/css-flexbox-1/#flex-wrap).
195///
196/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
197///
198/// The grammar is defined as:
199///
200/// ```text,ignore
201/// nowrap | wrap | wrap-reverse
202/// ```
203///
204/// https://drafts.csswg.org/css-flexbox-1/#flex-wrap
205#[syntax(" nowrap | wrap | wrap-reverse ")]
206#[derive(
207	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
208)]
209#[declaration_metadata(
210    initial = "nowrap",
211    applies_to = Flex,
212    animation_type = Discrete,
213    shorthand_group = FlexFlow,
214    property_group = Flexbox,
215    computed_value_type = Unknown,
216    canonical_order = "per grammar",
217)]
218#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
219#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.flex-wrap"))]
220#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
221#[derive(csskit_derives::NodeWithMetadata)]
222pub enum FlexWrapStyleValue {}