css_ast/values/anchor_position/mod.rs
1#![allow(warnings)]
2//! CSS Anchor Positioning
3//! https://drafts.csswg.org/css-anchor-position-2/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `anchor-name` as defined in [css-anchor-position-2](https://drafts.csswg.org/css-anchor-position-2/#anchor-name).
9///
10/// Anchor positioning places an element based on the position of another element. For example, you can place a tooltip next to the content it references.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// none | <dashed-ident>#
16/// ```
17///
18// https://drafts.csswg.org/css-anchor-position-2/#anchor-name
19#[syntax(" none | <dashed-ident># ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22 initial = "none",
23 applies_to = "all elements that generate a principal box",
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.anchor-name"))]
31#[visit]
32pub struct AnchorNameStyleValue<'a>;
33
34/// Represents the style value for `anchor-scope` as defined in [css-anchor-position-2](https://drafts.csswg.org/css-anchor-position-2/#anchor-scope).
35///
36/// Anchor positioning places an element based on the position of another element. For example, you can place a tooltip next to the content it references.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// none | all | <dashed-ident>#
42/// ```
43///
44// https://drafts.csswg.org/css-anchor-position-2/#anchor-scope
45#[syntax(" none | all | <dashed-ident># ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48 initial = "none",
49 applies_to = "all elements",
50 inherited = "no",
51 percentages = "n/a",
52 canonical_order = "per grammar",
53 animation_type = "discrete"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.anchor-scope"))]
57#[visit]
58pub enum AnchorScopeStyleValue<'a> {}
59
60/// Represents the style value for `position-anchor` as defined in [css-anchor-position-2](https://drafts.csswg.org/css-anchor-position-2/#position-anchor).
61///
62/// Anchor positioning places an element based on the position of another element. For example, you can place a tooltip next to the content it references.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// auto | <anchor-name>
68/// ```
69///
70// https://drafts.csswg.org/css-anchor-position-2/#position-anchor
71#[syntax(" auto | <anchor-name> ")]
72#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73#[style_value(
74 initial = "auto",
75 applies_to = "absolutely positioned boxes",
76 inherited = "no",
77 percentages = "n/a",
78 canonical_order = "per grammar",
79 animation_type = "discrete"
80)]
81#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.position-anchor"))]
83#[visit]
84pub struct PositionAnchorStyleValue;
85
86/// Represents the style value for `position-area` as defined in [css-anchor-position-2](https://drafts.csswg.org/css-anchor-position-2/#position-area).
87///
88/// Anchor positioning places an element based on the position of another element. For example, you can place a tooltip next to the content it references.
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// none | <position-area>
94/// ```
95///
96// https://drafts.csswg.org/css-anchor-position-2/#position-area
97#[syntax(" none | <position-area> ")]
98#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99#[style_value(
100 initial = "none",
101 applies_to = "positioned boxes with a default anchor box",
102 inherited = "no",
103 percentages = "n/a",
104 canonical_order = "per grammar",
105 animation_type = "tbd"
106)]
107#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
108#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.position-area"))]
109#[visit]
110pub struct PositionAreaStyleValue;
111
112// /// Represents the style value for `position-visibility` as defined in [css-anchor-position-2](https://drafts.csswg.org/css-anchor-position-2/#position-visibility).
113// ///
114// /// Anchor positioning places an element based on the position of another element. For example, you can place a tooltip next to the content it references.
115// ///
116// /// The grammar is defined as:
117// ///
118// /// ```text,ignore
119// /// always | [ anchors-valid || anchors-visible || no-overflow ]
120// /// ```
121// ///
122// // https://drafts.csswg.org/css-anchor-position-2/#position-visibility
123// #[syntax(" always | [ anchors-valid || anchors-visible || no-overflow ] ")]
124// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
125// #[style_value(
126// initial = "anchors-visible",
127// applies_to = "absolutely positioned boxes",
128// inherited = "no",
129// percentages = "n/a",
130// canonical_order = "per grammar",
131// animation_type = "discrete",
132// )]
133// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
134// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.position-visibility"))]
135// #[visit]
136// pub enum PositionVisibilityStyleValue {}
137
138// /// Represents the style value for `position-try-fallbacks` as defined in [css-anchor-position-2](https://drafts.csswg.org/css-anchor-position-2/#position-try-fallbacks).
139// ///
140// /// Anchor positioning places an element based on the position of another element. For example, you can place a tooltip next to the content it references.
141// ///
142// /// The grammar is defined as:
143// ///
144// /// ```text,ignore
145// /// none | [ [<dashed-ident> || <try-tactic>] | <'position-area'> ]#
146// /// ```
147// ///
148// // https://drafts.csswg.org/css-anchor-position-2/#position-try-fallbacks
149// #[syntax(" none | [ [<dashed-ident> || <try-tactic>] | <'position-area'> ]# ")]
150// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
151// #[style_value(
152// initial = "none",
153// applies_to = "absolutely positioned boxes",
154// inherited = "no",
155// percentages = "n/a",
156// canonical_order = "per grammar",
157// animation_type = "discrete",
158// )]
159// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
160// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.position-try-fallbacks"))]
161// #[visit]
162// pub enum PositionTryFallbacksStyleValue<'a> {}
163
164/// Represents the style value for `position-try-order` as defined in [css-anchor-position-2](https://drafts.csswg.org/css-anchor-position-2/#position-try-order).
165///
166/// Anchor positioning places an element based on the position of another element. For example, you can place a tooltip next to the content it references.
167///
168/// The grammar is defined as:
169///
170/// ```text,ignore
171/// normal | <try-size>
172/// ```
173///
174// https://drafts.csswg.org/css-anchor-position-2/#position-try-order
175#[syntax(" normal | <try-size> ")]
176#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
177#[style_value(
178 initial = "normal",
179 applies_to = "absolutely positioned boxes",
180 inherited = "no",
181 percentages = "n/a",
182 canonical_order = "per grammar",
183 animation_type = "discrete"
184)]
185#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
186#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.position-try-order"))]
187#[visit]
188pub enum PositionTryOrderStyleValue {}
189
190// /// Represents the style value for `position-try` as defined in [css-anchor-position-2](https://drafts.csswg.org/css-anchor-position-2/#position-try).
191// ///
192// /// Anchor positioning places an element based on the position of another element. For example, you can place a tooltip next to the content it references.
193// ///
194// /// The grammar is defined as:
195// ///
196// /// ```text,ignore
197// /// <'position-try-order'>? <'position-try-fallbacks'>
198// /// ```
199// ///
200// // https://drafts.csswg.org/css-anchor-position-2/#position-try
201// #[syntax(" <'position-try-order'>? <'position-try-fallbacks'> ")]
202// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
203// #[style_value(
204// initial = "see individual properties",
205// applies_to = "see individual properties",
206// inherited = "see individual properties",
207// percentages = "see individual properties",
208// canonical_order = "per grammar",
209// animation_type = "see individual properties",
210// )]
211// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
212// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.position-try"))]
213// #[visit]
214// pub struct PositionTryStyleValue;