css_ast/values/multicol/
mod.rs

1#![allow(warnings)]
2//! CSS Multi-column Layout Module Level 2
3//! https://drafts.csswg.org/css-multicol-2/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `column-width` as defined in [css-multicol-2](https://drafts.csswg.org/css-multicol-2/#column-width).
9///
10/// 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.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// auto | <length [0,∞]>
16/// ```
17///
18// https://drafts.csswg.org/css-multicol-2/#column-width
19#[syntax(" auto | <length [0,∞]> ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22	initial = "auto",
23	applies_to = "block containers except table wrapper boxes",
24	inherited = "no",
25	percentages = "n/a",
26	canonical_order = "per grammar",
27	animation_type = "by computed value type"
28)]
29#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.column-width"))]
31#[visit]
32pub struct ColumnWidthStyleValue;
33
34/// Represents the style value for `column-count` as defined in [css-multicol-2](https://drafts.csswg.org/css-multicol-2/#column-count).
35///
36/// 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.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// auto | <integer [1,∞]>
42/// ```
43///
44// https://drafts.csswg.org/css-multicol-2/#column-count
45#[syntax(" auto | <integer [1,∞]> ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48	initial = "auto",
49	applies_to = "block containers except table wrapper boxes",
50	inherited = "no",
51	percentages = "n/a",
52	canonical_order = "per grammar",
53	animation_type = "by computed value"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.column-count"))]
57#[visit]
58pub struct ColumnCountStyleValue;
59
60// /// Represents the style value for `columns` as defined in [css-multicol-2](https://drafts.csswg.org/css-multicol-2/#columns).
61// ///
62// /// 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.
63// ///
64// /// The grammar is defined as:
65// ///
66// /// ```text,ignore
67// /// [ <'column-width'> || <'column-count'> ] [ / <'column-height'> ]?
68// /// ```
69// ///
70// // https://drafts.csswg.org/css-multicol-2/#columns
71// #[syntax(" [ <'column-width'> || <'column-count'> ] [ / <'column-height'> ]? ")]
72// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73// #[style_value(
74// 	initial = "see individual properties",
75//   applies_to = "see individual properties",
76// 	inherited = "see individual properties",
77// 	percentages = "see individual properties",
78// 	canonical_order = "per grammar",
79// 	animation_type = "see individual properties",
80// )]
81// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.columns"))]
83// #[visit]
84// pub struct ColumnsStyleValue;
85
86/// Represents the style value for `column-span` as defined in [css-multicol-2](https://drafts.csswg.org/css-multicol-2/#column-span).
87///
88/// The column-span CSS property controls whether a child element extends across all columns of a multi-column parent.
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// none | <integer [1,∞]> | all | auto
94/// ```
95///
96// https://drafts.csswg.org/css-multicol-2/#column-span
97#[syntax(" none | <integer [1,∞]> | all | auto ")]
98#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99#[style_value(
100	initial = "none",
101	applies_to = "in-flow block-level elements",
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.column-span"))]
109#[visit]
110pub enum ColumnSpanStyleValue {}
111
112/// Represents the style value for `column-fill` as defined in [css-multicol-2](https://drafts.csswg.org/css-multicol-2/#column-fill).
113///
114/// The column-fill CSS property sets the distribution of content across columns in a multi-column layout.
115///
116/// The grammar is defined as:
117///
118/// ```text,ignore
119/// auto | balance | balance-all
120/// ```
121///
122// https://drafts.csswg.org/css-multicol-2/#column-fill
123#[syntax(" auto | balance | balance-all ")]
124#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
125#[style_value(
126	initial = "balance",
127	applies_to = "multicol containers",
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.column-fill"))]
135#[visit]
136pub enum ColumnFillStyleValue {}
137
138/// Represents the style value for `column-height` as defined in [css-multicol-2](https://drafts.csswg.org/css-multicol-2/#column-height).
139///
140/// The grammar is defined as:
141///
142/// ```text,ignore
143/// auto | <length [0,∞]>
144/// ```
145///
146// https://drafts.csswg.org/css-multicol-2/#column-height
147#[syntax(" auto | <length [0,∞]> ")]
148#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
149#[style_value(
150	initial = "auto",
151	applies_to = "block containers except table wrapper boxes",
152	inherited = "no",
153	percentages = "n/a",
154	canonical_order = "per grammar",
155	animation_type = "by computed value type"
156)]
157#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
158#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.column-height"))]
159#[visit]
160pub struct ColumnHeightStyleValue;
161
162/// Represents the style value for `column-wrap` as defined in [css-multicol-2](https://drafts.csswg.org/css-multicol-2/#column-wrap).
163///
164/// The grammar is defined as:
165///
166/// ```text,ignore
167/// auto | nowrap | wrap
168/// ```
169///
170// https://drafts.csswg.org/css-multicol-2/#column-wrap
171#[syntax(" auto | nowrap | wrap ")]
172#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
173#[style_value(
174	initial = "auto",
175	applies_to = "multicol containers",
176	inherited = "no",
177	percentages = "n/a",
178	canonical_order = "per grammar",
179	animation_type = "discrete"
180)]
181#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
182#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.column-wrap"))]
183#[visit]
184pub enum ColumnWrapStyleValue {}