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