css_ast/values/rhythm/
mod.rs

1#![allow(warnings)]
2//! CSS Rhythmic Sizing
3//! https://drafts.csswg.org/css-rhythm-1/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `block-step-size` as defined in [css-rhythm-1](https://drafts.csswg.org/css-rhythm-1/#block-step-size).
9///
10/// The grammar is defined as:
11///
12/// ```text,ignore
13/// none | <length [0,∞]>
14/// ```
15///
16// https://drafts.csswg.org/css-rhythm-1/#block-step-size
17#[syntax(" none | <length [0,∞]> ")]
18#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
19#[style_value(
20	initial = "none",
21	applies_to = "block-level boxes",
22	inherited = "no",
23	percentages = "n/a",
24	canonical_order = "per grammar",
25	animation_type = "by computed value type"
26)]
27#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
28#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.block-step-size"))]
29#[visit]
30pub struct BlockStepSizeStyleValue;
31
32/// Represents the style value for `block-step-insert` as defined in [css-rhythm-1](https://drafts.csswg.org/css-rhythm-1/#block-step-insert).
33///
34/// The grammar is defined as:
35///
36/// ```text,ignore
37/// margin-box | padding-box | content-box
38/// ```
39///
40// https://drafts.csswg.org/css-rhythm-1/#block-step-insert
41#[syntax(" margin-box | padding-box | content-box ")]
42#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
43#[style_value(
44	initial = "margin-box",
45	applies_to = "block-level boxes",
46	inherited = "no",
47	percentages = "n/a",
48	canonical_order = "per grammar",
49	animation_type = "discrete"
50)]
51#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
52#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.block-step-insert"))]
53#[visit]
54pub enum BlockStepInsertStyleValue {}
55
56/// Represents the style value for `block-step-align` as defined in [css-rhythm-1](https://drafts.csswg.org/css-rhythm-1/#block-step-align).
57///
58/// The grammar is defined as:
59///
60/// ```text,ignore
61/// auto | center | start | end
62/// ```
63///
64// https://drafts.csswg.org/css-rhythm-1/#block-step-align
65#[syntax(" auto | center | start | end ")]
66#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
67#[style_value(
68	initial = "auto",
69	applies_to = "block-level boxes",
70	inherited = "no",
71	percentages = "n/a",
72	canonical_order = "per grammar",
73	animation_type = "discrete"
74)]
75#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
76#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.block-step-align"))]
77#[visit]
78pub enum BlockStepAlignStyleValue {}
79
80/// Represents the style value for `block-step-round` as defined in [css-rhythm-1](https://drafts.csswg.org/css-rhythm-1/#block-step-round).
81///
82/// The grammar is defined as:
83///
84/// ```text,ignore
85/// up | down | nearest
86/// ```
87///
88// https://drafts.csswg.org/css-rhythm-1/#block-step-round
89#[syntax(" up | down | nearest ")]
90#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
91#[style_value(
92	initial = "up",
93	applies_to = "block-level boxes",
94	inherited = "no",
95	percentages = "n/a",
96	canonical_order = "per grammar",
97	animation_type = "discrete"
98)]
99#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
100#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.block-step-round"))]
101#[visit]
102pub enum BlockStepRoundStyleValue {}
103
104/// Represents the style value for `block-step` as defined in [css-rhythm-1](https://drafts.csswg.org/css-rhythm-1/#block-step).
105///
106/// The grammar is defined as:
107///
108/// ```text,ignore
109/// <'block-step-size'> || <'block-step-insert'> || <'block-step-align'> || <'block-step-round'>
110/// ```
111///
112// https://drafts.csswg.org/css-rhythm-1/#block-step
113#[syntax(" <'block-step-size'> || <'block-step-insert'> || <'block-step-align'> || <'block-step-round'> ")]
114#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
115#[style_value(
116	initial = "see individual properties",
117	applies_to = "block-level boxes",
118	inherited = "no",
119	percentages = "n/a",
120	canonical_order = "per grammar",
121	animation_type = "see individual properties"
122)]
123#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
124#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.block-step"))]
125#[visit]
126pub struct BlockStepStyleValue;
127
128/// Represents the style value for `line-height-step` as defined in [css-rhythm-1](https://drafts.csswg.org/css-rhythm-1/#line-height-step).
129///
130/// The grammar is defined as:
131///
132/// ```text,ignore
133/// <length [0,∞]>
134/// ```
135///
136// https://drafts.csswg.org/css-rhythm-1/#line-height-step
137#[syntax(" <length [0,∞]> ")]
138#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
139#[style_value(
140	initial = "0",
141	applies_to = "block containers",
142	inherited = "yes",
143	percentages = "n/a",
144	canonical_order = "per grammar",
145	animation_type = "by computed value type"
146)]
147#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
148#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.line-height-step"))]
149#[visit]
150pub struct LineHeightStepStyleValue;