css_ast/values/inline/mod.rs
1#![allow(warnings)]
2//! CSS Inline Layout Module Level 3
3//! https://drafts.csswg.org/css-inline-3/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `dominant-baseline` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#dominant-baseline).
9///
10/// The dominant-baseline CSS property sets the specific baseline used to align an elements's text and inline-level contents.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top
16/// ```
17///
18// https://drafts.csswg.org/css-inline-3/#dominant-baseline
19#[syntax(" auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22 initial = "auto",
23 applies_to = "block containers, inline boxes, table rows, grid containers, flex containers, and SVG text content elements",
24 inherited = "yes",
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.dominant-baseline"))]
31#[visit]
32pub enum DominantBaselineStyleValue {}
33
34// /// Represents the style value for `vertical-align` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#vertical-align).
35// ///
36// /// The vertical-align CSS property sets the vertical alignment of inline, inline-block, and table cell elements. It has no effect on block-level elements.
37// ///
38// /// The grammar is defined as:
39// ///
40// /// ```text,ignore
41// /// [ first | last] || <'alignment-baseline'> || <'baseline-shift'>
42// /// ```
43// ///
44// // https://drafts.csswg.org/css-inline-3/#vertical-align
45// #[syntax(" [ first | last] || <'alignment-baseline'> || <'baseline-shift'> ")]
46// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47// #[style_value(
48// initial = "baseline",
49// applies_to = "see individual properties",
50// inherited = "no",
51// percentages = "n/a",
52// canonical_order = "per grammar",
53// animation_type = "see individual properties",
54// )]
55// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.vertical-align"))]
57// #[visit]
58// pub struct VerticalAlignStyleValue;
59
60/// Represents the style value for `baseline-source` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#baseline-source).
61///
62/// The baseline-source CSS property controls how inline-level boxes with multiple lines of text are aligned with the surrounding text. By default, which typographic baseline is used depends on the display property value.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// auto | first | last
68/// ```
69///
70// https://drafts.csswg.org/css-inline-3/#baseline-source
71#[syntax(" auto | first | last ")]
72#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73#[style_value(
74 initial = "auto",
75 applies_to = "inline-level 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.baseline-source"))]
83#[visit]
84pub enum BaselineSourceStyleValue {}
85
86/// Represents the style value for `alignment-baseline` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#alignment-baseline).
87///
88/// The alignment-baseline CSS property sets which baseline of an element is aligned with the corresponding baseline of its parent.
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// baseline | text-bottom | alphabetic | ideographic | middle | central | mathematical | text-top
94/// ```
95///
96// https://drafts.csswg.org/css-inline-3/#alignment-baseline
97#[syntax(" baseline | text-bottom | alphabetic | ideographic | middle | central | mathematical | text-top ")]
98#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99#[style_value(
100 initial = "baseline",
101 applies_to = "inline-level boxes, flex items, grid items, table cells, and SVG text content elements",
102 inherited = "no",
103 percentages = "n/a",
104 canonical_order = "per grammar",
105 animation_type = "discrete"
106)]
107#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
108#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.alignment-baseline"))]
109#[visit]
110pub enum AlignmentBaselineStyleValue {}
111
112/// Represents the style value for `baseline-shift` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#baseline-shift).
113///
114/// The baseline-shift CSS property sets the position of an element relative to its dominant baseline.
115///
116/// The grammar is defined as:
117///
118/// ```text,ignore
119/// <length-percentage> | sub | super | top | center | bottom
120/// ```
121///
122// https://drafts.csswg.org/css-inline-3/#baseline-shift
123#[syntax(" <length-percentage> | sub | super | top | center | bottom ")]
124#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
125#[style_value(
126 initial = "0",
127 applies_to = "inline-level boxes and SVG text content elements",
128 inherited = "no",
129 percentages = "refer to the used value of line-height",
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.baseline-shift"))]
135#[visit]
136pub enum BaselineShiftStyleValue {}
137
138/// Represents the style value for `line-height` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#line-height).
139///
140/// The line-height CSS property sets the spacing between text baselines, oriented to the horizontal or vertical writing mode.
141///
142/// The grammar is defined as:
143///
144/// ```text,ignore
145/// normal | <number [0,∞]> | <length-percentage [0,∞]>
146/// ```
147///
148// https://drafts.csswg.org/css-inline-3/#line-height
149#[syntax(" normal | <number [0,∞]> | <length-percentage [0,∞]> ")]
150#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
151#[style_value(
152 initial = "normal",
153 applies_to = "non-replaced inline boxes and SVG text content elements",
154 inherited = "yes",
155 percentages = "computed relative to 1em",
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.line-height"))]
161#[visit]
162pub enum LineHeightStyleValue {}
163
164/// Represents the style value for `line-fit-edge` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#line-fit-edge).
165///
166/// The grammar is defined as:
167///
168/// ```text,ignore
169/// leading | <text-edge>
170/// ```
171///
172// https://drafts.csswg.org/css-inline-3/#line-fit-edge
173#[syntax(" leading | <text-edge> ")]
174#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
175#[style_value(
176 initial = "leading",
177 applies_to = "inline boxes",
178 inherited = "yes",
179 percentages = "n/a",
180 canonical_order = "per grammar",
181 animation_type = "discrete"
182)]
183#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
184#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.line-fit-edge"))]
185#[visit]
186pub enum LineFitEdgeStyleValue {}
187
188// /// Represents the style value for `text-box` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#text-box).
189// ///
190// /// The text-box CSS property sets the spacing above and below text based on a font's typographic features. For example, text-box: trim-both ex alphabetic trims the top to the top of the letter x and the bottom to the bottom of most letters, without descenders.
191// ///
192// /// The grammar is defined as:
193// ///
194// /// ```text,ignore
195// /// normal | <'text-box-trim'> || <'text-box-edge'>
196// /// ```
197// ///
198// // https://drafts.csswg.org/css-inline-3/#text-box
199// #[syntax(" normal | <'text-box-trim'> || <'text-box-edge'> ")]
200// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
201// #[style_value(
202// initial = "normal",
203// applies_to = "block containers, multi-column containers, and inline boxes",
204// inherited = "no",
205// percentages = "n/a",
206// canonical_order = "per grammar",
207// animation_type = "discrete",
208// )]
209// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
210// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.text-box"))]
211// #[visit]
212// pub enum TextBoxStyleValue {}
213
214/// Represents the style value for `text-box-trim` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#text-box-trim).
215///
216/// The text-box CSS property sets the spacing above and below text based on a font's typographic features. For example, text-box: trim-both ex alphabetic trims the top to the top of the letter x and the bottom to the bottom of most letters, without descenders.
217///
218/// The grammar is defined as:
219///
220/// ```text,ignore
221/// none | trim-start | trim-end | trim-both
222/// ```
223///
224// https://drafts.csswg.org/css-inline-3/#text-box-trim
225#[syntax(" none | trim-start | trim-end | trim-both ")]
226#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
227#[style_value(
228 initial = "none",
229 applies_to = "block containers, multi-column containers, and inline boxes",
230 inherited = "no",
231 percentages = "n/a",
232 canonical_order = "per grammar",
233 animation_type = "discrete"
234)]
235#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
236#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.text-box-trim"))]
237#[visit]
238pub enum TextBoxTrimStyleValue {}
239
240/// Represents the style value for `text-box-edge` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#text-box-edge).
241///
242/// The text-box CSS property sets the spacing above and below text based on a font's typographic features. For example, text-box: trim-both ex alphabetic trims the top to the top of the letter x and the bottom to the bottom of most letters, without descenders.
243///
244/// The grammar is defined as:
245///
246/// ```text,ignore
247/// auto | <text-edge>
248/// ```
249///
250// https://drafts.csswg.org/css-inline-3/#text-box-edge
251#[syntax(" auto | <text-edge> ")]
252#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
253#[style_value(
254 initial = "auto",
255 applies_to = "block containers and inline boxes",
256 inherited = "yes",
257 percentages = "n/a",
258 canonical_order = "per grammar",
259 animation_type = "discrete"
260)]
261#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
262#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.text-box-edge"))]
263#[visit]
264pub struct TextBoxEdgeStyleValue;
265
266/// Represents the style value for `inline-sizing` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#inline-sizing).
267///
268/// The grammar is defined as:
269///
270/// ```text,ignore
271/// normal | stretch
272/// ```
273///
274// https://drafts.csswg.org/css-inline-3/#inline-sizing
275#[syntax(" normal | stretch ")]
276#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
277#[style_value(
278 initial = "normal",
279 applies_to = "inline boxes, but not ruby container boxes nor internal ruby boxes",
280 inherited = "yes",
281 percentages = "n/a",
282 canonical_order = "per grammar",
283 animation_type = "discrete"
284)]
285#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
286#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.inline-sizing"))]
287#[visit]
288pub enum InlineSizingStyleValue {}
289
290// /// Represents the style value for `initial-letter` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#initial-letter).
291// ///
292// /// The initial-letter CSS property sets the number of lines the first letter of an element occupies. You can use the property to make a raised capital or drop cap.
293// ///
294// /// The grammar is defined as:
295// ///
296// /// ```text,ignore
297// /// normal | <number [1,∞]> <integer [1,∞]> | <number [1,∞]> && [ drop | raise ]?
298// /// ```
299// ///
300// // https://drafts.csswg.org/css-inline-3/#initial-letter
301// #[syntax(" normal | <number [1,∞]> <integer [1,∞]> | <number [1,∞]> && [ drop | raise ]? ")]
302// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
303// #[style_value(
304// initial = "normal",
305// applies_to = "certain inline-level boxes and ::first-letter and inside ::marker boxes (see prose)",
306// inherited = "no",
307// percentages = "n/a",
308// canonical_order = "per grammar",
309// animation_type = "by computed value type",
310// )]
311// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
312// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.initial-letter"))]
313// #[visit]
314// pub enum InitialLetterStyleValue {}
315
316// /// Represents the style value for `initial-letter-align` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#initial-letter-align).
317// ///
318// /// The grammar is defined as:
319// ///
320// /// ```text,ignore
321// /// [ border-box? [ alphabetic | ideographic | hanging | leading ]? ]!
322// /// ```
323// ///
324// // https://drafts.csswg.org/css-inline-3/#initial-letter-align
325// #[syntax(" [ border-box? [ alphabetic | ideographic | hanging | leading ]? ]! ")]
326// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
327// #[style_value(
328// initial = "alphabetic",
329// applies_to = "certain inline-level boxes and ::first-letter and inside ::marker boxes (see prose)",
330// inherited = "yes",
331// percentages = "n/a",
332// canonical_order = "per grammar",
333// animation_type = "discrete",
334// )]
335// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
336// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.initial-letter-align"))]
337// #[visit]
338// pub struct InitialLetterAlignStyleValue;
339
340/// Represents the style value for `initial-letter-wrap` as defined in [css-inline-3](https://drafts.csswg.org/css-inline-3/#initial-letter-wrap).
341///
342/// The grammar is defined as:
343///
344/// ```text,ignore
345/// none | first | all | grid | <length-percentage>
346/// ```
347///
348// https://drafts.csswg.org/css-inline-3/#initial-letter-wrap
349#[syntax(" none | first | all | grid | <length-percentage> ")]
350#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
351#[style_value(
352 initial = "none",
353 applies_to = "certain inline-level boxes and ::first-letter and inside ::marker boxes (see prose)",
354 inherited = "yes",
355 percentages = "relative to logical width of (last fragment of) initial letter",
356 canonical_order = "per grammar",
357 animation_type = "by computed value type"
358)]
359#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
360#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.initial-letter-wrap"))]
361#[visit]
362pub enum InitialLetterWrapStyleValue {}