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