css_ast/values/box/
mod.rs

1#![allow(warnings)]
2//! CSS Box Model Module Level 4
3//! https://drafts.csswg.org/css-box-4/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `margin-top` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-top).
9///
10/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// <length-percentage> | auto
16/// ```
17///
18// https://drafts.csswg.org/css-box-4/#margin-top
19#[syntax(" <length-percentage> | auto ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22	initial = "0",
23	applies_to = "all elements except internal table elements, ruby base containers, and ruby annotation containers",
24	inherited = "no",
25	percentages = "refer to logical width of containing block",
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.margin-top"))]
31#[visit]
32pub struct MarginTopStyleValue;
33
34/// Represents the style value for `margin-right` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-right).
35///
36/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// <length-percentage> | auto
42/// ```
43///
44// https://drafts.csswg.org/css-box-4/#margin-right
45#[syntax(" <length-percentage> | auto ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48	initial = "0",
49	applies_to = "all elements except internal table elements, ruby base containers, and ruby annotation containers",
50	inherited = "no",
51	percentages = "refer to logical width of containing block",
52	canonical_order = "per grammar",
53	animation_type = "by computed value type"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-right"))]
57#[visit]
58pub struct MarginRightStyleValue;
59
60/// Represents the style value for `margin-bottom` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-bottom).
61///
62/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// <length-percentage> | auto
68/// ```
69///
70// https://drafts.csswg.org/css-box-4/#margin-bottom
71#[syntax(" <length-percentage> | auto ")]
72#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73#[style_value(
74	initial = "0",
75	applies_to = "all elements except internal table elements, ruby base containers, and ruby annotation containers",
76	inherited = "no",
77	percentages = "refer to logical width of containing block",
78	canonical_order = "per grammar",
79	animation_type = "by computed value type"
80)]
81#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-bottom"))]
83#[visit]
84pub struct MarginBottomStyleValue;
85
86/// Represents the style value for `margin-left` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-left).
87///
88/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// <length-percentage> | auto
94/// ```
95///
96// https://drafts.csswg.org/css-box-4/#margin-left
97#[syntax(" <length-percentage> | auto ")]
98#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99#[style_value(
100	initial = "0",
101	applies_to = "all elements except internal table elements, ruby base containers, and ruby annotation containers",
102	inherited = "no",
103	percentages = "refer to logical width of containing block",
104	canonical_order = "per grammar",
105	animation_type = "by computed value type"
106)]
107#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
108#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-left"))]
109#[visit]
110pub struct MarginLeftStyleValue;
111
112/// Represents the style value for `margin` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin).
113///
114/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
115///
116/// The grammar is defined as:
117///
118/// ```text,ignore
119/// <'margin-top'>{1,4}
120/// ```
121///
122// https://drafts.csswg.org/css-box-4/#margin
123#[syntax(" <'margin-top'>{1,4} ")]
124#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
125#[style_value(
126	initial = "0",
127	applies_to = "all elements except internal table elements, ruby base containers, and ruby annotation containers",
128	inherited = "no",
129	percentages = "refer to logical width of containing block",
130	canonical_order = "per grammar",
131	animation_type = "by computed value type"
132)]
133#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
134#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin"))]
135#[visit]
136pub struct MarginStyleValue;
137
138/// Represents the style value for `padding-top` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-top).
139///
140/// The padding CSS property sets space between an element's edge and its contents. It is a shorthand for padding-top, padding-right, padding-bottom, and padding-left.
141///
142/// The grammar is defined as:
143///
144/// ```text,ignore
145/// <length-percentage [0,∞]>
146/// ```
147///
148// https://drafts.csswg.org/css-box-4/#padding-top
149#[syntax(" <length-percentage [0,∞]> ")]
150#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
151#[style_value(
152	initial = "0",
153	applies_to = "all elements except: internal table elements other than table cells, ruby base containers, and ruby annotation containers",
154	inherited = "no",
155	percentages = "refer to logical width of containing block",
156	canonical_order = "per grammar",
157	animation_type = "by computed value type"
158)]
159#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
160#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-top"))]
161#[visit]
162pub struct PaddingTopStyleValue;
163
164/// Represents the style value for `padding-right` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-right).
165///
166/// The padding CSS property sets space between an element's edge and its contents. It is a shorthand for padding-top, padding-right, padding-bottom, and padding-left.
167///
168/// The grammar is defined as:
169///
170/// ```text,ignore
171/// <length-percentage [0,∞]>
172/// ```
173///
174// https://drafts.csswg.org/css-box-4/#padding-right
175#[syntax(" <length-percentage [0,∞]> ")]
176#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
177#[style_value(
178	initial = "0",
179	applies_to = "all elements except: internal table elements other than table cells, ruby base containers, and ruby annotation containers",
180	inherited = "no",
181	percentages = "refer to logical width of containing block",
182	canonical_order = "per grammar",
183	animation_type = "by computed value type"
184)]
185#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
186#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-right"))]
187#[visit]
188pub struct PaddingRightStyleValue;
189
190/// Represents the style value for `padding-bottom` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-bottom).
191///
192/// The padding CSS property sets space between an element's edge and its contents. It is a shorthand for padding-top, padding-right, padding-bottom, and padding-left.
193///
194/// The grammar is defined as:
195///
196/// ```text,ignore
197/// <length-percentage [0,∞]>
198/// ```
199///
200// https://drafts.csswg.org/css-box-4/#padding-bottom
201#[syntax(" <length-percentage [0,∞]> ")]
202#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
203#[style_value(
204	initial = "0",
205	applies_to = "all elements except: internal table elements other than table cells, ruby base containers, and ruby annotation containers",
206	inherited = "no",
207	percentages = "refer to logical width of containing block",
208	canonical_order = "per grammar",
209	animation_type = "by computed value type"
210)]
211#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
212#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-bottom"))]
213#[visit]
214pub struct PaddingBottomStyleValue;
215
216/// Represents the style value for `padding-left` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-left).
217///
218/// The padding CSS property sets space between an element's edge and its contents. It is a shorthand for padding-top, padding-right, padding-bottom, and padding-left.
219///
220/// The grammar is defined as:
221///
222/// ```text,ignore
223/// <length-percentage [0,∞]>
224/// ```
225///
226// https://drafts.csswg.org/css-box-4/#padding-left
227#[syntax(" <length-percentage [0,∞]> ")]
228#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
229#[style_value(
230	initial = "0",
231	applies_to = "all elements except: internal table elements other than table cells, ruby base containers, and ruby annotation containers",
232	inherited = "no",
233	percentages = "refer to logical width of containing block",
234	canonical_order = "per grammar",
235	animation_type = "by computed value type"
236)]
237#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
238#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-left"))]
239#[visit]
240pub struct PaddingLeftStyleValue;
241
242/// Represents the style value for `padding` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding).
243///
244/// The padding CSS property sets space between an element's edge and its contents. It is a shorthand for padding-top, padding-right, padding-bottom, and padding-left.
245///
246/// The grammar is defined as:
247///
248/// ```text,ignore
249/// <'padding-top'>{1,4}
250/// ```
251///
252// https://drafts.csswg.org/css-box-4/#padding
253#[syntax(" <'padding-top'>{1,4} ")]
254#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
255#[style_value(
256	initial = "0",
257	applies_to = "all elements except: internal table elements other than table cells, ruby base containers, and ruby annotation containers",
258	inherited = "no",
259	percentages = "refer to logical width of containing block",
260	canonical_order = "per grammar",
261	animation_type = "by computed value type"
262)]
263#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
264#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding"))]
265#[visit]
266pub struct PaddingStyleValue;
267
268// /// Represents the style value for `margin-trim` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-trim).
269// ///
270// /// The margin-trim CSS property removes the margins of child elements when they meet the edges of the container.
271// ///
272// /// The grammar is defined as:
273// ///
274// /// ```text,ignore
275// /// none | [ block || inline ] | [ block-start || inline-start || block-end || inline-end ]
276// /// ```
277// ///
278// // https://drafts.csswg.org/css-box-4/#margin-trim
279// #[syntax(" none | [ block || inline ] | [ block-start || inline-start || block-end || inline-end ] ")]
280// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
281// #[style_value(
282// 	initial = "none",
283//   applies_to = "block containers, multi-column containers, flex containers, grid containers",
284// 	inherited = "no",
285// 	percentages = "n/a",
286// 	canonical_order = "per grammar",
287// 	animation_type = "discrete",
288// )]
289// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
290// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-trim"))]
291// #[visit]
292// pub enum MarginTrimStyleValue {}