Skip to main content

css_ast/values/box/
mod.rs

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