css_ast/values/position/
mod.rs

1#![allow(warnings)]
2//! CSS Positioned Layout Module Level 4
3//! https://drafts.csswg.org/css-position-4/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `position` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#position).
9///
10/// The position CSS property sets the origin position of an element to an element, the element's scrollport, or the viewport.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// static | relative | absolute | sticky | fixed
16/// ```
17///
18// https://drafts.csswg.org/css-position-4/#position
19#[syntax(" static | relative | absolute | sticky | fixed ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22	initial = "static",
23	applies_to = "all elements except table-column-group and table-column",
24	inherited = "no",
25	percentages = "n/a",
26	canonical_order = "per grammar",
27	animation_type = "discrete"
28)]
29#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.position"))]
31#[visit]
32pub enum PositionStyleValue {}
33
34/// Represents the style value for `top` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#top).
35///
36/// The physical CSS properties, top, right, bottom, and left, set the inset position of an element relative to the corresponding side of a container determined by the element's position property.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// auto | <length-percentage>
42/// ```
43///
44// https://drafts.csswg.org/css-position-4/#top
45#[syntax(" auto | <length-percentage> ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48	initial = "auto",
49	applies_to = "positioned elements",
50	inherited = "no",
51	percentages = "refer to size of containing block; see prose",
52	canonical_order = "per grammar",
53	animation_type = "by computed value type"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.top"))]
57#[visit]
58pub struct TopStyleValue;
59
60/// Represents the style value for `right` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#right).
61///
62/// The physical CSS properties, top, right, bottom, and left, set the inset position of an element relative to the corresponding side of a container determined by the element's position property.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// auto | <length-percentage>
68/// ```
69///
70// https://drafts.csswg.org/css-position-4/#right
71#[syntax(" auto | <length-percentage> ")]
72#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73#[style_value(
74	initial = "auto",
75	applies_to = "positioned elements",
76	inherited = "no",
77	percentages = "refer to size of containing block; see prose",
78	canonical_order = "per grammar",
79	animation_type = "by computed value type"
80)]
81#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.right"))]
83#[visit]
84pub struct RightStyleValue;
85
86/// Represents the style value for `bottom` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#bottom).
87///
88/// The physical CSS properties, top, right, bottom, and left, set the inset position of an element relative to the corresponding side of a container determined by the element's position property.
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// auto | <length-percentage>
94/// ```
95///
96// https://drafts.csswg.org/css-position-4/#bottom
97#[syntax(" auto | <length-percentage> ")]
98#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99#[style_value(
100	initial = "auto",
101	applies_to = "positioned elements",
102	inherited = "no",
103	percentages = "refer to size of containing block; see prose",
104	canonical_order = "per grammar",
105	animation_type = "by computed value type"
106)]
107#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
108#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.bottom"))]
109#[visit]
110pub struct BottomStyleValue;
111
112/// Represents the style value for `left` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#left).
113///
114/// The physical CSS properties, top, right, bottom, and left, set the inset position of an element relative to the corresponding side of a container determined by the element's position property.
115///
116/// The grammar is defined as:
117///
118/// ```text,ignore
119/// auto | <length-percentage>
120/// ```
121///
122// https://drafts.csswg.org/css-position-4/#left
123#[syntax(" auto | <length-percentage> ")]
124#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
125#[style_value(
126	initial = "auto",
127	applies_to = "positioned elements",
128	inherited = "no",
129	percentages = "refer to size of containing block; see prose",
130	canonical_order = "per grammar",
131	animation_type = "by computed value type"
132)]
133#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
134#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.left"))]
135#[visit]
136pub struct LeftStyleValue;
137
138/// Represents the style value for `inset-block-start` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#inset-block-start).
139///
140/// 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.
141///
142/// The grammar is defined as:
143///
144/// ```text,ignore
145/// auto | <length-percentage>
146/// ```
147///
148// https://drafts.csswg.org/css-position-4/#inset-block-start
149#[syntax(" auto | <length-percentage> ")]
150#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
151#[style_value(
152	initial = "auto",
153	applies_to = "positioned elements",
154	inherited = "no",
155	percentages = "refer to size of containing block; see prose",
156	canonical_order = "per grammar",
157	animation_type = "by computed value type"
158)]
159#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
160#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.inset-block-start"))]
161#[visit]
162pub struct InsetBlockStartStyleValue;
163
164/// Represents the style value for `inset-inline-start` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#inset-inline-start).
165///
166/// 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.
167///
168/// The grammar is defined as:
169///
170/// ```text,ignore
171/// auto | <length-percentage>
172/// ```
173///
174// https://drafts.csswg.org/css-position-4/#inset-inline-start
175#[syntax(" auto | <length-percentage> ")]
176#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
177#[style_value(
178	initial = "auto",
179	applies_to = "positioned elements",
180	inherited = "no",
181	percentages = "refer to size of containing block; see prose",
182	canonical_order = "per grammar",
183	animation_type = "by computed value type"
184)]
185#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
186#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.inset-inline-start"))]
187#[visit]
188pub struct InsetInlineStartStyleValue;
189
190/// Represents the style value for `inset-block-end` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#inset-block-end).
191///
192/// 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.
193///
194/// The grammar is defined as:
195///
196/// ```text,ignore
197/// auto | <length-percentage>
198/// ```
199///
200// https://drafts.csswg.org/css-position-4/#inset-block-end
201#[syntax(" auto | <length-percentage> ")]
202#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
203#[style_value(
204	initial = "auto",
205	applies_to = "positioned elements",
206	inherited = "no",
207	percentages = "refer to size of containing block; see prose",
208	canonical_order = "per grammar",
209	animation_type = "by computed value type"
210)]
211#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
212#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.inset-block-end"))]
213#[visit]
214pub struct InsetBlockEndStyleValue;
215
216/// Represents the style value for `inset-inline-end` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#inset-inline-end).
217///
218/// 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.
219///
220/// The grammar is defined as:
221///
222/// ```text,ignore
223/// auto | <length-percentage>
224/// ```
225///
226// https://drafts.csswg.org/css-position-4/#inset-inline-end
227#[syntax(" auto | <length-percentage> ")]
228#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
229#[style_value(
230	initial = "auto",
231	applies_to = "positioned elements",
232	inherited = "no",
233	percentages = "refer to size of containing block; see prose",
234	canonical_order = "per grammar",
235	animation_type = "by computed value type"
236)]
237#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
238#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.inset-inline-end"))]
239#[visit]
240pub struct InsetInlineEndStyleValue;
241
242/// Represents the style value for `inset-block` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#inset-block).
243///
244/// 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.
245///
246/// The grammar is defined as:
247///
248/// ```text,ignore
249/// <'top'>{1,2}
250/// ```
251///
252// https://drafts.csswg.org/css-position-4/#inset-block
253#[syntax(" <'top'>{1,2} ")]
254#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
255#[style_value(
256	initial = "auto",
257	applies_to = "positioned elements",
258	inherited = "no",
259	percentages = "see individual properties",
260	canonical_order = "per grammar",
261	animation_type = "by computed value type"
262)]
263#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
264#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.inset-block"))]
265#[visit]
266pub struct InsetBlockStyleValue;
267
268/// Represents the style value for `inset-inline` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#inset-inline).
269///
270/// 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.
271///
272/// The grammar is defined as:
273///
274/// ```text,ignore
275/// <'top'>{1,2}
276/// ```
277///
278// https://drafts.csswg.org/css-position-4/#inset-inline
279#[syntax(" <'top'>{1,2} ")]
280#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
281#[style_value(
282	initial = "auto",
283	applies_to = "positioned elements",
284	inherited = "no",
285	percentages = "see individual properties",
286	canonical_order = "per grammar",
287	animation_type = "by computed value type"
288)]
289#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
290#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.inset-inline"))]
291#[visit]
292pub struct InsetInlineStyleValue;
293
294/// Represents the style value for `inset` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#inset).
295///
296/// 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.
297///
298/// The grammar is defined as:
299///
300/// ```text,ignore
301/// <'top'>{1,4}
302/// ```
303///
304// https://drafts.csswg.org/css-position-4/#inset
305#[syntax(" <'top'>{1,4} ")]
306#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
307#[style_value(
308	initial = "auto",
309	applies_to = "positioned elements",
310	inherited = "no",
311	percentages = "see individual properties",
312	canonical_order = "per grammar",
313	animation_type = "by computed value type"
314)]
315#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
316#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.inset"))]
317#[visit]
318pub struct InsetStyleValue;
319
320/// Represents the style value for `overlay` as defined in [css-position-4](https://drafts.csswg.org/css-position-4/#overlay).
321///
322/// The overlay CSS property, used as an allow-discrete CSS transition, prevents a top layer element, such as a popover or a <dialog>, from being removed from the top layer before it has finished animating. You can't set the value of the overlay property; only use it as transition property.
323///
324/// The grammar is defined as:
325///
326/// ```text,ignore
327/// none | auto
328/// ```
329///
330// https://drafts.csswg.org/css-position-4/#overlay
331#[syntax(" none | auto ")]
332#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
333#[style_value(
334	initial = "none",
335	applies_to = "all elements",
336	inherited = "no",
337	percentages = "n/a",
338	canonical_order = "per grammar",
339	animation_type = "see prose"
340)]
341#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
342#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.overlay"))]
343#[visit]
344pub enum OverlayStyleValue {}