css_ast/values/align/mod.rs
1#![allow(warnings)]
2//! CSS Box Alignment Module Level 3
3//! https://drafts.csswg.org/css-align-3/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `align-content` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#align-content).
9///
10/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>
16/// ```
17///
18// https://drafts.csswg.org/css-align-3/#align-content
19#[syntax(" normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position> ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22 initial = "normal",
23 applies_to = "block containers, multicol containers, flex containers, and grid containers",
24 inherited = "no",
25 percentages = "n/a",
26 canonical_order = "per grammar",
27 animation_type = "discrete"
28)]
29#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.align-content"))]
31#[visit]
32pub enum AlignContentStyleValue {}
33
34// /// Represents the style value for `justify-content` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#justify-content).
35// ///
36// /// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
37// ///
38// /// The grammar is defined as:
39// ///
40// /// ```text,ignore
41// /// normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]
42// /// ```
43// ///
44// // https://drafts.csswg.org/css-align-3/#justify-content
45// #[syntax(" normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ] ")]
46// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47// #[style_value(
48// initial = "normal",
49// applies_to = "multicol containers, flex containers, and grid containers",
50// inherited = "no",
51// percentages = "n/a",
52// canonical_order = "per grammar",
53// animation_type = "discrete",
54// )]
55// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.justify-content"))]
57// #[visit]
58// pub enum JustifyContentStyleValue {}
59
60// /// Represents the style value for `place-content` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#place-content).
61// ///
62// /// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
63// ///
64// /// The grammar is defined as:
65// ///
66// /// ```text,ignore
67// /// <'align-content'> <'justify-content'>?
68// /// ```
69// ///
70// // https://drafts.csswg.org/css-align-3/#place-content
71// #[syntax(" <'align-content'> <'justify-content'>? ")]
72// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73// #[style_value(
74// initial = "normal",
75// applies_to = "see individual properties",
76// inherited = "no",
77// percentages = "n/a",
78// canonical_order = "per grammar",
79// animation_type = "discrete",
80// )]
81// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.place-content"))]
83// #[visit]
84// pub struct PlaceContentStyleValue;
85
86// /// Represents the style value for `justify-self` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#justify-self).
87// ///
88// /// CSS grid is a two-dimensional layout system, which lays content out in rows and columns.
89// ///
90// /// The grammar is defined as:
91// ///
92// /// ```text,ignore
93// /// auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]
94// /// ```
95// ///
96// // https://drafts.csswg.org/css-align-3/#justify-self
97// #[syntax(" auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] ")]
98// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99// #[style_value(
100// initial = "auto",
101// applies_to = "block-level boxes, absolutely-positioned boxes, and grid items",
102// inherited = "no",
103// percentages = "n/a",
104// canonical_order = "per grammar",
105// animation_type = "discrete",
106// )]
107// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
108// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.justify-self"))]
109// #[visit]
110// pub enum JustifySelfStyleValue {}
111
112/// Represents the style value for `align-self` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#align-self).
113///
114/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
115///
116/// The grammar is defined as:
117///
118/// ```text,ignore
119/// auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>
120/// ```
121///
122// https://drafts.csswg.org/css-align-3/#align-self
123#[syntax(" auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position> ")]
124#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
125#[style_value(
126 initial = "auto",
127 applies_to = "flex items, grid items, and absolutely-positioned boxes",
128 inherited = "no",
129 percentages = "n/a",
130 canonical_order = "per grammar",
131 animation_type = "discrete"
132)]
133#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
134#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.align-self"))]
135#[visit]
136pub enum AlignSelfStyleValue {}
137
138// /// Represents the style value for `place-self` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#place-self).
139// ///
140// /// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
141// ///
142// /// The grammar is defined as:
143// ///
144// /// ```text,ignore
145// /// <'align-self'> <'justify-self'>?
146// /// ```
147// ///
148// // https://drafts.csswg.org/css-align-3/#place-self
149// #[syntax(" <'align-self'> <'justify-self'>? ")]
150// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
151// #[style_value(
152// initial = "auto",
153// applies_to = "see individual properties",
154// inherited = "no",
155// percentages = "n/a",
156// canonical_order = "per grammar",
157// animation_type = "discrete",
158// )]
159// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
160// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.place-self"))]
161// #[visit]
162// pub struct PlaceSelfStyleValue;
163
164// /// Represents the style value for `justify-items` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#justify-items).
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// /// normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]
172// /// ```
173// ///
174// // https://drafts.csswg.org/css-align-3/#justify-items
175// #[syntax(
176// " normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ] "
177// )]
178// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
179// #[style_value(
180// initial = "legacy",
181// applies_to = "all elements",
182// inherited = "no",
183// percentages = "n/a",
184// canonical_order = "per grammar",
185// animation_type = "discrete",
186// )]
187// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
188// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.justify-items"))]
189// #[visit]
190// pub enum JustifyItemsStyleValue {}
191
192// /// Represents the style value for `align-items` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#align-items).
193// ///
194// /// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
195// ///
196// /// The grammar is defined as:
197// ///
198// /// ```text,ignore
199// /// normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]
200// /// ```
201// ///
202// // https://drafts.csswg.org/css-align-3/#align-items
203// #[syntax(" normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ] ")]
204// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
205// #[style_value(
206// initial = "normal",
207// applies_to = "all elements",
208// inherited = "no",
209// percentages = "n/a",
210// canonical_order = "per grammar",
211// animation_type = "discrete",
212// )]
213// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
214// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.align-items"))]
215// #[visit]
216// pub enum AlignItemsStyleValue {}
217
218// /// Represents the style value for `place-items` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#place-items).
219// ///
220// /// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
221// ///
222// /// The grammar is defined as:
223// ///
224// /// ```text,ignore
225// /// <'align-items'> <'justify-items'>?
226// /// ```
227// ///
228// // https://drafts.csswg.org/css-align-3/#place-items
229// #[syntax(" <'align-items'> <'justify-items'>? ")]
230// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
231// #[style_value(
232// initial = "see individual properties",
233// applies_to = "all elements",
234// inherited = "no",
235// percentages = "n/a",
236// canonical_order = "per grammar",
237// animation_type = "discrete",
238// )]
239// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
240// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.place-items"))]
241// #[visit]
242// pub struct PlaceItemsStyleValue;
243
244/// Represents the style value for `row-gap` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#row-gap).
245///
246/// CSS grid is a two-dimensional layout system, which lays content out in rows and columns.
247///
248/// The grammar is defined as:
249///
250/// ```text,ignore
251/// normal | <length-percentage [0,∞]>
252/// ```
253///
254// https://drafts.csswg.org/css-align-3/#row-gap
255#[syntax(" normal | <length-percentage [0,∞]> ")]
256#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
257#[style_value(
258 initial = "normal",
259 applies_to = "multi-column containers, flex containers, grid containers",
260 inherited = "no",
261 percentages = "see § 8.3 percentages in gap properties",
262 canonical_order = "per grammar",
263 animation_type = "by computed value type"
264)]
265#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
266#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.row-gap"))]
267#[visit]
268pub enum RowGapStyleValue {}
269
270/// Represents the style value for `column-gap` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#column-gap).
271///
272/// Multi-column layout flows an element's content across one or more columns in a single row, without affecting the display property of its children.
273///
274/// The grammar is defined as:
275///
276/// ```text,ignore
277/// normal | <length-percentage [0,∞]>
278/// ```
279///
280// https://drafts.csswg.org/css-align-3/#column-gap
281#[syntax(" normal | <length-percentage [0,∞]> ")]
282#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
283#[style_value(
284 initial = "normal",
285 applies_to = "multi-column containers, flex containers, grid containers",
286 inherited = "no",
287 percentages = "see § 8.3 percentages in gap properties",
288 canonical_order = "per grammar",
289 animation_type = "by computed value type"
290)]
291#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
292#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.column-gap"))]
293#[visit]
294pub enum ColumnGapStyleValue {}
295
296/// Represents the style value for `gap` as defined in [css-align-3](https://drafts.csswg.org/css-align-3/#gap).
297///
298/// CSS grid is a two-dimensional layout system, which lays content out in rows and columns.
299///
300/// The grammar is defined as:
301///
302/// ```text,ignore
303/// <'row-gap'> <'column-gap'>?
304/// ```
305///
306// https://drafts.csswg.org/css-align-3/#gap
307#[syntax(" <'row-gap'> <'column-gap'>? ")]
308#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
309#[style_value(
310 initial = "see individual properties",
311 applies_to = "multi-column containers, flex containers, grid containers",
312 inherited = "no",
313 percentages = "refer to corresponding dimension of the content area",
314 canonical_order = "per grammar",
315 animation_type = "by computed value type"
316)]
317#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
318#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.gap"))]
319#[visit]
320pub struct GapStyleValue;