css_ast/values/page_floats/
mod.rs

1#![allow(warnings)]
2//! CSS Page Floats
3//! https://drafts.csswg.org/css-page-floats-3/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `float-reference` as defined in [css-page-floats-3](https://drafts.csswg.org/css-page-floats-3/#float-reference).
9///
10/// The grammar is defined as:
11///
12/// ```text,ignore
13/// inline | column | region | page
14/// ```
15///
16// https://drafts.csswg.org/css-page-floats-3/#float-reference
17#[syntax(" inline | column | region | page ")]
18#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
19#[style_value(
20	initial = "inline",
21	applies_to = "all elements.",
22	inherited = "no",
23	percentages = "n/a",
24	canonical_order = "per grammar",
25	animation_type = "discrete"
26)]
27#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
28#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.float-reference"))]
29#[visit]
30pub enum FloatReferenceStyleValue {}
31
32/// Represents the style value for `float` as defined in [css-page-floats-3](https://drafts.csswg.org/css-page-floats-3/#float).
33///
34/// The float CSS property aligns an element to either side of its container, allowing text and inline elements to flow around it. The clear CSS property sets whether an element is moved below floating elements that proceed it.
35///
36/// The grammar is defined as:
37///
38/// ```text,ignore
39/// block-start | block-end | inline-start | inline-end | snap-block | <snap-block()> | snap-inline | <snap-inline()> | left | right | top | bottom | none
40/// ```
41///
42// https://drafts.csswg.org/css-page-floats-3/#float
43#[syntax(
44	" block-start | block-end | inline-start | inline-end | snap-block | <snap-block()> | snap-inline | <snap-inline()> | left | right | top | bottom | none "
45)]
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 = "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.float"))]
57#[visit]
58pub enum FloatStyleValue {}
59
60/// Represents the style value for `clear` as defined in [css-page-floats-3](https://drafts.csswg.org/css-page-floats-3/#clear).
61///
62/// The float CSS property aligns an element to either side of its container, allowing text and inline elements to flow around it. The clear CSS property sets whether an element is moved below floating elements that proceed it.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// inline-start | inline-end | block-start | block-end | left | right | top | bottom | both-inline | both-block | both | none
68/// ```
69///
70// https://drafts.csswg.org/css-page-floats-3/#clear
71#[syntax(
72	" inline-start | inline-end | block-start | block-end | left | right | top | bottom | both-inline | both-block | both | none "
73)]
74#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
75#[style_value(
76	initial = "none",
77	applies_to = "block-level elements, floats, regions, pages",
78	inherited = "no",
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.clear"))]
85#[visit]
86pub enum ClearStyleValue {}
87
88/// Represents the style value for `float-defer` as defined in [css-page-floats-3](https://drafts.csswg.org/css-page-floats-3/#float-defer).
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// <integer> | last | none
94/// ```
95///
96// https://drafts.csswg.org/css-page-floats-3/#float-defer
97#[syntax(" <integer> | last | none ")]
98#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99#[style_value(
100	initial = "none",
101	applies_to = "floats",
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.float-defer"))]
109#[visit]
110pub enum FloatDeferStyleValue {}
111
112/// Represents the style value for `float-offset` as defined in [css-page-floats-3](https://drafts.csswg.org/css-page-floats-3/#float-offset).
113///
114/// The grammar is defined as:
115///
116/// ```text,ignore
117/// <length-percentage>
118/// ```
119///
120// https://drafts.csswg.org/css-page-floats-3/#float-offset
121#[syntax(" <length-percentage> ")]
122#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
123#[style_value(
124	initial = "0",
125	applies_to = "floats",
126	inherited = "no",
127	percentages = "see prose",
128	canonical_order = "per grammar",
129	animation_type = "by computed value type"
130)]
131#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
132#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.float-offset"))]
133#[visit]
134pub struct FloatOffsetStyleValue;