css_ast/values/box/
mod.rs

1#![allow(warnings)]
2//! https://drafts.csswg.org/css-box-4/
3
4mod impls;
5use super::prelude::*;
6use impls::*;
7/// Represents the style value for `margin` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin).
8///
9/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
10///
11/// The grammar is defined as:
12///
13/// ```text,ignore
14/// <'margin-top'>{1,4}
15/// ```
16///
17/// https://drafts.csswg.org/css-box-4/#margin
18#[syntax(" <'margin-top'>{1,4} ")]
19#[derive(
20	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
21)]
22#[declaration_metadata(
23    initial = "0",
24    applies_to = Unknown,
25    percentages = ContainingBlock,
26    animation_type = ByComputedValue,
27    property_group = Box,
28    computed_value_type = Unknown,
29    canonical_order = "per grammar",
30    box_side = Top|Bottom|Left|Right,
31    box_portion = Margin,
32)]
33#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
34#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin"))]
35#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
36pub struct MarginStyleValue;
37
38/// Represents the style value for `margin-bottom` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-bottom).
39///
40/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
41///
42/// The grammar is defined as:
43///
44/// ```text,ignore
45/// <length-percentage> | auto
46/// ```
47///
48/// https://drafts.csswg.org/css-box-4/#margin-bottom
49#[syntax(" <length-percentage> | auto ")]
50#[derive(
51	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
52)]
53#[declaration_metadata(
54    initial = "0",
55    applies_to = Unknown,
56    percentages = ContainingBlock,
57    animation_type = ByComputedValue,
58    property_group = Box,
59    computed_value_type = Unknown,
60    canonical_order = "per grammar",
61    logical_property_group = Margin,
62    box_side = Bottom,
63    box_portion = Margin,
64)]
65#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
66#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-bottom"))]
67#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
68pub struct MarginBottomStyleValue;
69
70/// Represents the style value for `margin-left` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-left).
71///
72/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
73///
74/// The grammar is defined as:
75///
76/// ```text,ignore
77/// <length-percentage> | auto
78/// ```
79///
80/// https://drafts.csswg.org/css-box-4/#margin-left
81#[syntax(" <length-percentage> | auto ")]
82#[derive(
83	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
84)]
85#[declaration_metadata(
86    initial = "0",
87    applies_to = Unknown,
88    percentages = ContainingBlock,
89    animation_type = ByComputedValue,
90    property_group = Box,
91    computed_value_type = Unknown,
92    canonical_order = "per grammar",
93    logical_property_group = Margin,
94    box_side = Left,
95    box_portion = Margin,
96)]
97#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
98#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-left"))]
99#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
100pub struct MarginLeftStyleValue;
101
102/// Represents the style value for `margin-right` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-right).
103///
104/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
105///
106/// The grammar is defined as:
107///
108/// ```text,ignore
109/// <length-percentage> | auto
110/// ```
111///
112/// https://drafts.csswg.org/css-box-4/#margin-right
113#[syntax(" <length-percentage> | auto ")]
114#[derive(
115	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
116)]
117#[declaration_metadata(
118    initial = "0",
119    applies_to = Unknown,
120    percentages = ContainingBlock,
121    animation_type = ByComputedValue,
122    property_group = Box,
123    computed_value_type = Unknown,
124    canonical_order = "per grammar",
125    logical_property_group = Margin,
126    box_side = Right,
127    box_portion = Margin,
128)]
129#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
130#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-right"))]
131#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
132pub struct MarginRightStyleValue;
133
134/// Represents the style value for `margin-top` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-top).
135///
136/// The margin CSS property sets space around an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left.
137///
138/// The grammar is defined as:
139///
140/// ```text,ignore
141/// <length-percentage> | auto
142/// ```
143///
144/// https://drafts.csswg.org/css-box-4/#margin-top
145#[syntax(" <length-percentage> | auto ")]
146#[derive(
147	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
148)]
149#[declaration_metadata(
150    initial = "0",
151    applies_to = Unknown,
152    percentages = ContainingBlock,
153    animation_type = ByComputedValue,
154    property_group = Box,
155    computed_value_type = Unknown,
156    canonical_order = "per grammar",
157    logical_property_group = Margin,
158    box_side = Top,
159    box_portion = Margin,
160)]
161#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
162#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-top"))]
163#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
164pub struct MarginTopStyleValue;
165
166// /// Represents the style value for `margin-trim` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#margin-trim).
167// ///
168// /// The margin-trim CSS property removes the margins of child elements when they meet the edges of the container.
169// ///
170// /// The grammar is defined as:
171// ///
172// /// ```text,ignore
173// /// none | [ block || inline ] | [ block-start || inline-start || block-end || inline-end ]
174// /// ```
175// ///
176// /// https://drafts.csswg.org/css-box-4/#margin-trim
177// #[syntax(
178//     " none | [ block || inline ] | [ block-start || inline-start || block-end || inline-end ] "
179// )]
180// #[derive(
181//     Parse,
182//     Peek,
183//     ToSpan,
184//     ToCursors,
185//     DeclarationMetadata,
186//     SemanticEq,
187//     Debug,
188//     Clone,
189//     PartialEq,
190//     Eq,
191//     PartialOrd,
192//     Ord,
193//     Hash,
194// )]
195// #[declaration_metadata(
196//     initial = "none",
197//     applies_to = Unknown,
198//     animation_type = Discrete,
199//     property_group = Box,
200//     computed_value_type = Unknown,
201//     canonical_order = "per grammar",
202//     box_portion = Margin,
203// )]
204// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
205// #[cfg_attr(
206//     feature = "css_feature_data",
207//     derive(ToCSSFeature),
208//     css_feature("css.properties.margin-trim")
209// )]
210// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
211// pub enum MarginTrimStyleValue {}
212
213/// Represents the style value for `padding` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding).
214///
215/// 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.
216///
217/// The grammar is defined as:
218///
219/// ```text,ignore
220/// <'padding-top'>{1,4}
221/// ```
222///
223/// https://drafts.csswg.org/css-box-4/#padding
224#[syntax(" <'padding-top'>{1,4} ")]
225#[derive(
226	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
227)]
228#[declaration_metadata(
229    initial = "0",
230    applies_to = Unknown,
231    percentages = ContainingBlock,
232    animation_type = ByComputedValue,
233    property_group = Box,
234    computed_value_type = Unknown,
235    canonical_order = "per grammar",
236    box_side = Top|Bottom|Left|Right,
237    box_portion = Padding,
238)]
239#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
240#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding"))]
241#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
242pub struct PaddingStyleValue;
243
244/// Represents the style value for `padding-bottom` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-bottom).
245///
246/// 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.
247///
248/// The grammar is defined as:
249///
250/// ```text,ignore
251/// <length-percentage [0,∞]>
252/// ```
253///
254/// https://drafts.csswg.org/css-box-4/#padding-bottom
255#[syntax(" <length-percentage [0,∞]> ")]
256#[derive(
257	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
258)]
259#[declaration_metadata(
260    initial = "0",
261    applies_to = Unknown,
262    percentages = ContainingBlock,
263    animation_type = ByComputedValue,
264    property_group = Box,
265    computed_value_type = Unknown,
266    canonical_order = "per grammar",
267    logical_property_group = Padding,
268    box_side = Bottom,
269    box_portion = Padding,
270)]
271#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
272#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-bottom"))]
273#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
274pub struct PaddingBottomStyleValue;
275
276/// Represents the style value for `padding-left` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-left).
277///
278/// 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.
279///
280/// The grammar is defined as:
281///
282/// ```text,ignore
283/// <length-percentage [0,∞]>
284/// ```
285///
286/// https://drafts.csswg.org/css-box-4/#padding-left
287#[syntax(" <length-percentage [0,∞]> ")]
288#[derive(
289	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
290)]
291#[declaration_metadata(
292    initial = "0",
293    applies_to = Unknown,
294    percentages = ContainingBlock,
295    animation_type = ByComputedValue,
296    property_group = Box,
297    computed_value_type = Unknown,
298    canonical_order = "per grammar",
299    logical_property_group = Padding,
300    box_side = Left,
301    box_portion = Padding,
302)]
303#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
304#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-left"))]
305#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
306pub struct PaddingLeftStyleValue;
307
308/// Represents the style value for `padding-right` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-right).
309///
310/// 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.
311///
312/// The grammar is defined as:
313///
314/// ```text,ignore
315/// <length-percentage [0,∞]>
316/// ```
317///
318/// https://drafts.csswg.org/css-box-4/#padding-right
319#[syntax(" <length-percentage [0,∞]> ")]
320#[derive(
321	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
322)]
323#[declaration_metadata(
324    initial = "0",
325    applies_to = Unknown,
326    percentages = ContainingBlock,
327    animation_type = ByComputedValue,
328    property_group = Box,
329    computed_value_type = Unknown,
330    canonical_order = "per grammar",
331    logical_property_group = Padding,
332    box_side = Right,
333    box_portion = Padding,
334)]
335#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
336#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-right"))]
337#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
338pub struct PaddingRightStyleValue;
339
340/// Represents the style value for `padding-top` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-top).
341///
342/// 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.
343///
344/// The grammar is defined as:
345///
346/// ```text,ignore
347/// <length-percentage [0,∞]>
348/// ```
349///
350/// https://drafts.csswg.org/css-box-4/#padding-top
351#[syntax(" <length-percentage [0,∞]> ")]
352#[derive(
353	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
354)]
355#[declaration_metadata(
356    initial = "0",
357    applies_to = Unknown,
358    percentages = ContainingBlock,
359    animation_type = ByComputedValue,
360    property_group = Box,
361    computed_value_type = Unknown,
362    canonical_order = "per grammar",
363    logical_property_group = Padding,
364    box_side = Top,
365    box_portion = Padding,
366)]
367#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
368#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-top"))]
369#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
370pub struct PaddingTopStyleValue;