css_ast/values/logical/
mod.rs

1#![allow(warnings)]
2//! CSS Logical Properties and Values Module Level 1
3//! https://drafts.csswg.org/css-logical-1/
4
5mod impls;
6
7use super::prelude::*;
8use impls::*;
9
10/// Represents the style value for `block-size` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#block-size).
11///
12/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
13///
14/// The grammar is defined as:
15///
16/// ```text,ignore
17/// <'width'>
18/// ```
19///
20// https://drafts.csswg.org/css-logical-1/#block-size
21#[syntax(" <'width'> ")]
22#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
23#[style_value(
24	initial = "auto",
25	applies_to = "Same as height and width",
26	inherited = "no",
27	percentages = "as for the corresponding physical property",
28	canonical_order = "per grammar",
29	animation_type = "by computed value type"
30)]
31#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
32#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.block-size"))]
33#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
34pub struct BlockSizeStyleValue;
35
36/// Represents the style value for `inline-size` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#inline-size).
37///
38/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
39///
40/// The grammar is defined as:
41///
42/// ```text,ignore
43/// <'width'>
44/// ```
45///
46// https://drafts.csswg.org/css-logical-1/#inline-size
47#[syntax(" <'width'> ")]
48#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
49#[style_value(
50	initial = "auto",
51	applies_to = "Same as height and width",
52	inherited = "no",
53	percentages = "as for the corresponding physical property",
54	canonical_order = "per grammar",
55	animation_type = "by computed value type"
56)]
57#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
58#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.inline-size"))]
59#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
60pub struct InlineSizeStyleValue;
61
62/// Represents the style value for `margin-block` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#margin-block).
63///
64/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
65///
66/// The grammar is defined as:
67///
68/// ```text,ignore
69/// <'margin-top'>{1,2}
70/// ```
71///
72// https://drafts.csswg.org/css-logical-1/#margin-block
73#[syntax(" <'margin-top'>{1,2} ")]
74#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
75#[style_value(
76	initial = "see individual properties",
77	applies_to = "see individual properties",
78	inherited = "see individual properties",
79	percentages = "see individual properties",
80	canonical_order = "per grammar",
81	animation_type = "see individual properties"
82)]
83#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
84#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-block"))]
85#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
86pub struct MarginBlockStyleValue;
87
88/// Represents the style value for `margin-block-end` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#margin-block-end).
89///
90/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
91///
92/// The grammar is defined as:
93///
94/// ```text,ignore
95/// <'margin-top'>
96/// ```
97///
98// https://drafts.csswg.org/css-logical-1/#margin-block-end
99#[syntax(" <'margin-top'> ")]
100#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
101#[style_value(
102	initial = "0",
103	applies_to = "Same as margin-top",
104	inherited = "no",
105	percentages = "as for the corresponding physical property",
106	canonical_order = "per grammar",
107	animation_type = "by computed value type"
108)]
109#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
110#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-block-end"))]
111#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
112pub struct MarginBlockEndStyleValue;
113
114/// Represents the style value for `margin-block-start` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#margin-block-start).
115///
116/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
117///
118/// The grammar is defined as:
119///
120/// ```text,ignore
121/// <'margin-top'>
122/// ```
123///
124// https://drafts.csswg.org/css-logical-1/#margin-block-start
125#[syntax(" <'margin-top'> ")]
126#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
127#[style_value(
128	initial = "0",
129	applies_to = "Same as margin-top",
130	inherited = "no",
131	percentages = "as for the corresponding physical property",
132	canonical_order = "per grammar",
133	animation_type = "by computed value type"
134)]
135#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
136#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-block-start"))]
137#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
138pub struct MarginBlockStartStyleValue;
139
140/// Represents the style value for `margin-inline` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#margin-inline).
141///
142/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
143///
144/// The grammar is defined as:
145///
146/// ```text,ignore
147/// <'margin-top'>{1,2}
148/// ```
149///
150// https://drafts.csswg.org/css-logical-1/#margin-inline
151#[syntax(" <'margin-top'>{1,2} ")]
152#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
153#[style_value(
154	initial = "see individual properties",
155	applies_to = "see individual properties",
156	inherited = "see individual properties",
157	percentages = "see individual properties",
158	canonical_order = "per grammar",
159	animation_type = "see individual properties"
160)]
161#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
162#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-inline"))]
163#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
164pub struct MarginInlineStyleValue;
165
166/// Represents the style value for `margin-inline-end` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#margin-inline-end).
167///
168/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
169///
170/// The grammar is defined as:
171///
172/// ```text,ignore
173/// <'margin-top'>
174/// ```
175///
176// https://drafts.csswg.org/css-logical-1/#margin-inline-end
177#[syntax(" <'margin-top'> ")]
178#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
179#[style_value(
180	initial = "0",
181	applies_to = "Same as margin-top",
182	inherited = "no",
183	percentages = "as for the corresponding physical property",
184	canonical_order = "per grammar",
185	animation_type = "by computed value type"
186)]
187#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
188#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-inline-end"))]
189#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
190pub struct MarginInlineEndStyleValue;
191
192/// Represents the style value for `margin-inline-start` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#margin-inline-start).
193///
194/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
195///
196/// The grammar is defined as:
197///
198/// ```text,ignore
199/// <'margin-top'>
200/// ```
201///
202// https://drafts.csswg.org/css-logical-1/#margin-inline-start
203#[syntax(" <'margin-top'> ")]
204#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
205#[style_value(
206	initial = "0",
207	applies_to = "Same as margin-top",
208	inherited = "no",
209	percentages = "as for the corresponding physical property",
210	canonical_order = "per grammar",
211	animation_type = "by computed value type"
212)]
213#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
214#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.margin-inline-start"))]
215#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
216pub struct MarginInlineStartStyleValue;
217
218/// Represents the style value for `max-block-size` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#max-block-size).
219///
220/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
221///
222/// The grammar is defined as:
223///
224/// ```text,ignore
225/// <'max-width'>
226/// ```
227///
228// https://drafts.csswg.org/css-logical-1/#max-block-size
229#[syntax(" <'max-width'> ")]
230#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
231#[style_value(
232	initial = "none",
233	applies_to = "same as height and width",
234	inherited = "no",
235	percentages = "as for the corresponding physical property",
236	canonical_order = "per grammar",
237	animation_type = "by computed value type"
238)]
239#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
240#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.max-block-size"))]
241#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
242pub struct MaxBlockSizeStyleValue;
243
244/// Represents the style value for `max-inline-size` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#max-inline-size).
245///
246/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
247///
248/// The grammar is defined as:
249///
250/// ```text,ignore
251/// <'max-width'>
252/// ```
253///
254// https://drafts.csswg.org/css-logical-1/#max-inline-size
255#[syntax(" <'max-width'> ")]
256#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
257#[style_value(
258	initial = "none",
259	applies_to = "same as height and width",
260	inherited = "no",
261	percentages = "as for the corresponding physical property",
262	canonical_order = "per grammar",
263	animation_type = "by computed value type"
264)]
265#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
266#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.max-inline-size"))]
267#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
268pub struct MaxInlineSizeStyleValue;
269
270/// Represents the style value for `min-block-size` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#min-block-size).
271///
272/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
273///
274/// The grammar is defined as:
275///
276/// ```text,ignore
277/// <'min-width'>
278/// ```
279///
280// https://drafts.csswg.org/css-logical-1/#min-block-size
281#[syntax(" <'min-width'> ")]
282#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
283#[style_value(
284	initial = "0",
285	applies_to = "same as height and width",
286	inherited = "no",
287	percentages = "as for the corresponding physical property",
288	canonical_order = "per grammar",
289	animation_type = "by computed value type"
290)]
291#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
292#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.min-block-size"))]
293#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
294pub struct MinBlockSizeStyleValue;
295
296/// Represents the style value for `min-inline-size` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#min-inline-size).
297///
298/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
299///
300/// The grammar is defined as:
301///
302/// ```text,ignore
303/// <'min-width'>
304/// ```
305///
306// https://drafts.csswg.org/css-logical-1/#min-inline-size
307#[syntax(" <'min-width'> ")]
308#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
309#[style_value(
310	initial = "0",
311	applies_to = "same as height and width",
312	inherited = "no",
313	percentages = "as for the corresponding physical property",
314	canonical_order = "per grammar",
315	animation_type = "by computed value type"
316)]
317#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
318#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.min-inline-size"))]
319#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
320pub struct MinInlineSizeStyleValue;
321
322/// Represents the style value for `padding-block` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#padding-block).
323///
324/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
325///
326/// The grammar is defined as:
327///
328/// ```text,ignore
329/// <'padding-top'>{1,2}
330/// ```
331///
332// https://drafts.csswg.org/css-logical-1/#padding-block
333#[syntax(" <'padding-top'>{1,2} ")]
334#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
335#[style_value(
336	initial = "see individual properties",
337	applies_to = "see individual properties",
338	inherited = "see individual properties",
339	percentages = "see individual properties",
340	canonical_order = "per grammar",
341	animation_type = "see individual properties"
342)]
343#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
344#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-block"))]
345#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
346pub struct PaddingBlockStyleValue;
347
348/// Represents the style value for `padding-block-end` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#padding-block-end).
349///
350/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
351///
352/// The grammar is defined as:
353///
354/// ```text,ignore
355/// <'padding-top'>
356/// ```
357///
358// https://drafts.csswg.org/css-logical-1/#padding-block-end
359#[syntax(" <'padding-top'> ")]
360#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
361#[style_value(
362	initial = "0",
363	applies_to = "Same as padding-top",
364	inherited = "no",
365	percentages = "as for the corresponding physical property",
366	canonical_order = "per grammar",
367	animation_type = "by computed value type"
368)]
369#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
370#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-block-end"))]
371#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
372pub struct PaddingBlockEndStyleValue;
373
374/// Represents the style value for `padding-block-start` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#padding-block-start).
375///
376/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
377///
378/// The grammar is defined as:
379///
380/// ```text,ignore
381/// <'padding-top'>
382/// ```
383///
384// https://drafts.csswg.org/css-logical-1/#padding-block-start
385#[syntax(" <'padding-top'> ")]
386#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
387#[style_value(
388	initial = "0",
389	applies_to = "Same as padding-top",
390	inherited = "no",
391	percentages = "as for the corresponding physical property",
392	canonical_order = "per grammar",
393	animation_type = "by computed value type"
394)]
395#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
396#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-block-start"))]
397#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
398pub struct PaddingBlockStartStyleValue;
399
400/// Represents the style value for `padding-inline` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#padding-inline).
401///
402/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
403///
404/// The grammar is defined as:
405///
406/// ```text,ignore
407/// <'padding-top'>{1,2}
408/// ```
409///
410// https://drafts.csswg.org/css-logical-1/#padding-inline
411#[syntax(" <'padding-top'>{1,2} ")]
412#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
413#[style_value(
414	initial = "see individual properties",
415	applies_to = "see individual properties",
416	inherited = "see individual properties",
417	percentages = "see individual properties",
418	canonical_order = "per grammar",
419	animation_type = "see individual properties"
420)]
421#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
422#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-inline"))]
423#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
424pub struct PaddingInlineStyleValue;
425
426/// Represents the style value for `padding-inline-end` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#padding-inline-end).
427///
428/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
429///
430/// The grammar is defined as:
431///
432/// ```text,ignore
433/// <'padding-top'>
434/// ```
435///
436// https://drafts.csswg.org/css-logical-1/#padding-inline-end
437#[syntax(" <'padding-top'> ")]
438#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
439#[style_value(
440	initial = "0",
441	applies_to = "Same as padding-top",
442	inherited = "no",
443	percentages = "as for the corresponding physical property",
444	canonical_order = "per grammar",
445	animation_type = "by computed value type"
446)]
447#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
448#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-inline-end"))]
449#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
450pub struct PaddingInlineEndStyleValue;
451
452/// Represents the style value for `padding-inline-start` as defined in [css-logical-1](https://drafts.csswg.org/css-logical-1/#padding-inline-start).
453///
454/// CSS logical properties control borders, size, margin, and padding with directions and dimensions relative to the writing mode. For example, in a left to right, top to bottom writing mode, block-end refers to the bottom. Also known as flow relative.
455///
456/// The grammar is defined as:
457///
458/// ```text,ignore
459/// <'padding-top'>
460/// ```
461///
462// https://drafts.csswg.org/css-logical-1/#padding-inline-start
463#[syntax(" <'padding-top'> ")]
464#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
465#[style_value(
466	initial = "0",
467	applies_to = "Same as padding-top",
468	inherited = "no",
469	percentages = "as for the corresponding physical property",
470	canonical_order = "per grammar",
471	animation_type = "by computed value type"
472)]
473#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
474#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.padding-inline-start"))]
475#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
476pub struct PaddingInlineStartStyleValue;