css_ast/values/box/
mod.rs

1// AUTO-GENERATED from w3c/csswg-drafts
2// Commit: https://github.com/w3c/csswg-drafts/commit/7e27ad7484307dfdbe9d0e18ad19d02859389688
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(
191//     " none | [ block || inline ] | [ block-start || inline-start || block-end || inline-end ] "
192// )]
193// #[derive(
194//     Parse,
195//     Peek,
196//     ToSpan,
197//     ToCursors,
198//     DeclarationMetadata,
199//     SemanticEq,
200//     Debug,
201//     Clone,
202//     PartialEq,
203//     Eq,
204//     PartialOrd,
205//     Ord,
206//     Hash,
207// )]
208// #[declaration_metadata(
209//     initial = "none",
210//     applies_to = Unknown,
211//     animation_type = Discrete,
212//     property_group = Box,
213//     computed_value_type = Unknown,
214//     canonical_order = "per grammar",
215//     box_portion = Margin,
216// )]
217// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
218// #[cfg_attr(
219//     feature = "css_feature_data",
220//     derive(ToCSSFeature),
221//     css_feature("css.properties.margin-trim")
222// )]
223// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
224// #[derive(csskit_derives::NodeWithMetadata)]
225// pub enum MarginTrimStyleValue {}
226
227/// Represents the style value for `padding` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding).
228///
229/// 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.
230///
231/// The grammar is defined as:
232///
233/// ```text,ignore
234/// <'padding-top'>{1,4}
235/// ```
236///
237/// https://drafts.csswg.org/css-box-4/#padding
238#[syntax(" <'padding-top'>{1,4} ")]
239#[derive(
240	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
241)]
242#[declaration_metadata(
243    initial = "0",
244    applies_to = Unknown,
245    animation_type = ByComputedValue,
246    percentages = ContainingBlock,
247    longhands = PaddingBottom|PaddingLeft|PaddingRight|PaddingTop,
248    property_group = Box,
249    computed_value_type = Unknown,
250    canonical_order = "per grammar",
251    box_side = Top|Bottom|Left|Right,
252    box_portion = Padding,
253)]
254#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
255#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding"))]
256#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
257#[derive(csskit_derives::NodeWithMetadata)]
258pub struct PaddingStyleValue;
259
260/// Represents the style value for `padding-bottom` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-bottom).
261///
262/// 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.
263///
264/// The grammar is defined as:
265///
266/// ```text,ignore
267/// <length-percentage [0,∞]>
268/// ```
269///
270/// https://drafts.csswg.org/css-box-4/#padding-bottom
271#[syntax(" <length-percentage [0,∞]> ")]
272#[derive(
273	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
274)]
275#[declaration_metadata(
276    initial = "0",
277    applies_to = Unknown,
278    animation_type = ByComputedValue,
279    percentages = ContainingBlock,
280    shorthand_group = Padding,
281    property_group = Box,
282    computed_value_type = Unknown,
283    canonical_order = "per grammar",
284    logical_property_group = Padding,
285    box_side = Bottom,
286    box_portion = Padding,
287)]
288#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
289#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-bottom"))]
290#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
291#[derive(csskit_derives::NodeWithMetadata)]
292pub struct PaddingBottomStyleValue;
293
294/// Represents the style value for `padding-left` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-left).
295///
296/// 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.
297///
298/// The grammar is defined as:
299///
300/// ```text,ignore
301/// <length-percentage [0,∞]>
302/// ```
303///
304/// https://drafts.csswg.org/css-box-4/#padding-left
305#[syntax(" <length-percentage [0,∞]> ")]
306#[derive(
307	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
308)]
309#[declaration_metadata(
310    initial = "0",
311    applies_to = Unknown,
312    animation_type = ByComputedValue,
313    percentages = ContainingBlock,
314    shorthand_group = Padding,
315    property_group = Box,
316    computed_value_type = Unknown,
317    canonical_order = "per grammar",
318    logical_property_group = Padding,
319    box_side = Left,
320    box_portion = Padding,
321)]
322#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
323#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-left"))]
324#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
325#[derive(csskit_derives::NodeWithMetadata)]
326pub struct PaddingLeftStyleValue;
327
328/// Represents the style value for `padding-right` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-right).
329///
330/// 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.
331///
332/// The grammar is defined as:
333///
334/// ```text,ignore
335/// <length-percentage [0,∞]>
336/// ```
337///
338/// https://drafts.csswg.org/css-box-4/#padding-right
339#[syntax(" <length-percentage [0,∞]> ")]
340#[derive(
341	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
342)]
343#[declaration_metadata(
344    initial = "0",
345    applies_to = Unknown,
346    animation_type = ByComputedValue,
347    percentages = ContainingBlock,
348    shorthand_group = Padding,
349    property_group = Box,
350    computed_value_type = Unknown,
351    canonical_order = "per grammar",
352    logical_property_group = Padding,
353    box_side = Right,
354    box_portion = Padding,
355)]
356#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
357#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-right"))]
358#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
359#[derive(csskit_derives::NodeWithMetadata)]
360pub struct PaddingRightStyleValue;
361
362/// Represents the style value for `padding-top` as defined in [css-box-4](https://drafts.csswg.org/css-box-4/#padding-top).
363///
364/// 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.
365///
366/// The grammar is defined as:
367///
368/// ```text,ignore
369/// <length-percentage [0,∞]>
370/// ```
371///
372/// https://drafts.csswg.org/css-box-4/#padding-top
373#[syntax(" <length-percentage [0,∞]> ")]
374#[derive(
375	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
376)]
377#[declaration_metadata(
378    initial = "0",
379    applies_to = Unknown,
380    animation_type = ByComputedValue,
381    percentages = ContainingBlock,
382    shorthand_group = Padding,
383    property_group = Box,
384    computed_value_type = Unknown,
385    canonical_order = "per grammar",
386    logical_property_group = Padding,
387    box_side = Top,
388    box_portion = Padding,
389)]
390#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
391#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-top"))]
392#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
393#[derive(csskit_derives::NodeWithMetadata)]
394pub struct PaddingTopStyleValue;