css_ast/values/flexbox/
mod.rs

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