css_ast/values/display/mod.rs
1#![allow(warnings)]
2//! CSS Display Module Level 4
3//! https://drafts.csswg.org/css-display-4/
4
5mod impls;
6use impls::*;
7
8// /// Represents the style value for `display` as defined in [css-display-4](https://drafts.csswg.org/css-display-4/#display).
9// ///
10// /// The display CSS property sets the display behavior of an element's box within its layout and sets the layout behavior for its child elements.
11// ///
12// /// The grammar is defined as:
13// ///
14// /// ```text,ignore
15// /// [ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>
16// /// ```
17// ///
18// // https://drafts.csswg.org/css-display-4/#display
19// #[syntax(
20// " [ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy> "
21// )]
22// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
23// #[style_value(
24// initial = "inline",
25// applies_to = "all elements",
26// inherited = "no",
27// percentages = "n/a",
28// canonical_order = "per grammar",
29// animation_type = "see § 2.9 animating and interpolating display",
30// )]
31// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
32// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.display"))]
33// #[visit]
34// pub enum DisplayStyleValue {}
35
36/// Represents the style value for `order` as defined in [css-display-4](https://drafts.csswg.org/css-display-4/#order).
37///
38/// Flexbox is a one-dimensional layout system, which places content either horizontally or vertically, with optional wrapping.
39///
40/// The grammar is defined as:
41///
42/// ```text,ignore
43/// <integer>
44/// ```
45///
46// https://drafts.csswg.org/css-display-4/#order
47#[syntax(" <integer> ")]
48#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
49#[style_value(
50 initial = "0",
51 applies_to = "flex items and grid items",
52 inherited = "no",
53 percentages = "n/a",
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.order"))]
59#[visit]
60pub struct OrderStyleValue;
61
62/// Represents the style value for `visibility` as defined in [css-display-4](https://drafts.csswg.org/css-display-4/#visibility).
63///
64/// The visibility CSS property sets whether an element is shown. Invisible elements still affect the document layout.
65///
66/// The grammar is defined as:
67///
68/// ```text,ignore
69/// visible | hidden | force-hidden | collapse
70/// ```
71///
72// https://drafts.csswg.org/css-display-4/#visibility
73#[syntax(" visible | hidden | force-hidden | collapse ")]
74#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
75#[style_value(
76 initial = "visible",
77 applies_to = "all elements",
78 inherited = "yes",
79 percentages = "n/a",
80 canonical_order = "per grammar",
81 animation_type = "discrete"
82)]
83#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
84#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.visibility"))]
85#[visit]
86pub enum VisibilityStyleValue {}
87
88/// Represents the style value for `reading-flow` as defined in [css-display-4](https://drafts.csswg.org/css-display-4/#reading-flow).
89///
90/// The reading-flow CSS property sets the order in which flex or grid elements are rendered to speech or reached via focus navigation. The reading-order property overrides this order.
91///
92/// The grammar is defined as:
93///
94/// ```text,ignore
95/// normal | source-order | flex-visual | flex-flow | grid-rows | grid-columns | grid-order
96/// ```
97///
98// https://drafts.csswg.org/css-display-4/#reading-flow
99#[syntax(" normal | source-order | flex-visual | flex-flow | grid-rows | grid-columns | grid-order ")]
100#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
101#[style_value(
102 initial = "normal",
103 applies_to = "block, flex and grid containers",
104 inherited = "no",
105 percentages = "n/a",
106 canonical_order = "per grammar",
107 animation_type = "not animatable"
108)]
109#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
110#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.reading-flow"))]
111#[visit]
112pub enum ReadingFlowStyleValue {}
113
114/// Represents the style value for `reading-order` as defined in [css-display-4](https://drafts.csswg.org/css-display-4/#reading-order).
115///
116/// The reading-flow CSS property sets the order in which flex or grid elements are rendered to speech or reached via focus navigation. The reading-order property overrides this order.
117///
118/// The grammar is defined as:
119///
120/// ```text,ignore
121/// <integer>
122/// ```
123///
124// https://drafts.csswg.org/css-display-4/#reading-order
125#[syntax(" <integer> ")]
126#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
127#[style_value(
128 initial = "0",
129 applies_to = "Direct block-level, grid item, or flex item children of a reading flow container.",
130 inherited = "no",
131 percentages = "n/a",
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.reading-order"))]
137#[visit]
138pub struct ReadingOrderStyleValue;