css_ast/values/break/
mod.rs

1#![allow(warnings)]
2//! CSS Fragmentation Module Level 4  Breaking the Web, one fragment at a time
3//! https://drafts.csswg.org/css-break-4/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `break-before` as defined in [css-break-4](https://drafts.csswg.org/css-break-4/#break-before).
9///
10/// In printed page layouts, the break-after, break-before, break-inside CSS properties control where printed pages start and end. Also known as pagination or page breaking.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region
16/// ```
17///
18// https://drafts.csswg.org/css-break-4/#break-before
19#[syntax(
20	" auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region "
21)]
22#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
23#[style_value(
24	initial = "auto",
25	applies_to = "block-level boxes, grid items, flex items, table row groups, table rows (but see prose)",
26	inherited = "no",
27	percentages = "n/a",
28	canonical_order = "per grammar",
29	animation_type = "discrete"
30)]
31#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
32#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.break-before"))]
33#[visit]
34pub enum BreakBeforeStyleValue {}
35
36/// Represents the style value for `break-after` as defined in [css-break-4](https://drafts.csswg.org/css-break-4/#break-after).
37///
38/// In printed page layouts, the break-after, break-before, break-inside CSS properties control where printed pages start and end. Also known as pagination or page breaking.
39///
40/// The grammar is defined as:
41///
42/// ```text,ignore
43/// auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region
44/// ```
45///
46// https://drafts.csswg.org/css-break-4/#break-after
47#[syntax(
48	" auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region "
49)]
50#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
51#[style_value(
52	initial = "auto",
53	applies_to = "block-level boxes, grid items, flex items, table row groups, table rows (but see prose)",
54	inherited = "no",
55	percentages = "n/a",
56	canonical_order = "per grammar",
57	animation_type = "discrete"
58)]
59#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
60#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.break-after"))]
61#[visit]
62pub enum BreakAfterStyleValue {}
63
64/// Represents the style value for `break-inside` as defined in [css-break-4](https://drafts.csswg.org/css-break-4/#break-inside).
65///
66/// In printed page layouts, the break-after, break-before, break-inside CSS properties control where printed pages start and end. Also known as pagination or page breaking.
67///
68/// The grammar is defined as:
69///
70/// ```text,ignore
71/// auto | avoid | avoid-page | avoid-column | avoid-region
72/// ```
73///
74// https://drafts.csswg.org/css-break-4/#break-inside
75#[syntax(" auto | avoid | avoid-page | avoid-column | avoid-region ")]
76#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
77#[style_value(
78	initial = "auto",
79	applies_to = "all elements except inline-level boxes, internal ruby boxes, table column boxes, table column group boxes, absolutely-positioned boxes",
80	inherited = "no",
81	percentages = "n/a",
82	canonical_order = "per grammar",
83	animation_type = "discrete"
84)]
85#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
86#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.break-inside"))]
87#[visit]
88pub enum BreakInsideStyleValue {}
89
90/// Represents the style value for `orphans` as defined in [css-break-4](https://drafts.csswg.org/css-break-4/#orphans).
91///
92/// The widows and orphans CSS properties set the minimum lines included in a text fragment created by page, column, or region breaks.
93///
94/// The grammar is defined as:
95///
96/// ```text,ignore
97/// <integer [1,∞]>
98/// ```
99///
100// https://drafts.csswg.org/css-break-4/#orphans
101#[syntax(" <integer [1,∞]> ")]
102#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
103#[style_value(
104	initial = "2",
105	applies_to = "block containers that establish an inline formatting context",
106	inherited = "yes",
107	percentages = "n/a",
108	canonical_order = "per grammar",
109	animation_type = "by computed value type"
110)]
111#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
112#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.orphans"))]
113#[visit]
114pub struct OrphansStyleValue;
115
116/// Represents the style value for `widows` as defined in [css-break-4](https://drafts.csswg.org/css-break-4/#widows).
117///
118/// The widows and orphans CSS properties set the minimum lines included in a text fragment created by page, column, or region breaks.
119///
120/// The grammar is defined as:
121///
122/// ```text,ignore
123/// <integer [1,∞]>
124/// ```
125///
126// https://drafts.csswg.org/css-break-4/#widows
127#[syntax(" <integer [1,∞]> ")]
128#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
129#[style_value(
130	initial = "2",
131	applies_to = "block containers that establish an inline formatting context",
132	inherited = "yes",
133	percentages = "n/a",
134	canonical_order = "per grammar",
135	animation_type = "by computed value type"
136)]
137#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
138#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.widows"))]
139#[visit]
140pub struct WidowsStyleValue;
141
142/// Represents the style value for `box-decoration-break` as defined in [css-break-4](https://drafts.csswg.org/css-break-4/#box-decoration-break).
143///
144/// The box-decoration-break CSS property sets whether box decorations, such as borders or backgrounds, of an element divided across a page, column, or region wraps each fragment or splits across the break.
145///
146/// The grammar is defined as:
147///
148/// ```text,ignore
149/// slice | clone
150/// ```
151///
152// https://drafts.csswg.org/css-break-4/#box-decoration-break
153#[syntax(" slice | clone ")]
154#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
155#[style_value(
156	initial = "slice",
157	applies_to = "all elements",
158	inherited = "no",
159	percentages = "n/a",
160	canonical_order = "per grammar",
161	animation_type = "discrete"
162)]
163#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
164#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.box-decoration-break"))]
165#[visit]
166pub enum BoxDecorationBreakStyleValue {}
167
168/// Represents the style value for `margin-break` as defined in [css-break-4](https://drafts.csswg.org/css-break-4/#margin-break).
169///
170/// The grammar is defined as:
171///
172/// ```text,ignore
173/// auto | keep | discard
174/// ```
175///
176// https://drafts.csswg.org/css-break-4/#margin-break
177#[syntax(" auto | keep | discard ")]
178#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
179#[style_value(
180	initial = "auto",
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.margin-break"))]
189#[visit]
190pub enum MarginBreakStyleValue {}