css_ast/values/shapes/
mod.rs

1#![allow(warnings)]
2//! CSS Shapes Module Level 2
3//! https://drafts.csswg.org/css-shapes-2/
4
5mod impls;
6use impls::*;
7
8// /// Represents the style value for `shape-outside` as defined in [css-shapes-2](https://drafts.csswg.org/css-shapes-2/#shape-outside).
9// ///
10// /// The shape-outside CSS property, along with shape-margin and shape-image-threshold, sets the shape around which adjacent content will wrap.
11// ///
12// /// The grammar is defined as:
13// ///
14// /// ```text,ignore
15// /// none | [ <basic-shape> || <shape-box> ] | <image>
16// /// ```
17// ///
18// // https://drafts.csswg.org/css-shapes-2/#shape-outside
19// #[syntax(" none | [ <basic-shape> || <shape-box> ] | <image> ")]
20// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21// #[style_value(
22// 	initial = "none",
23//   applies_to = "floats and initial letter boxes",
24// 	inherited = "no",
25// 	percentages = "n/a",
26// 	canonical_order = "per grammar",
27// 	animation_type = "as defined for <basic-shape>, otherwise discrete",
28// )]
29// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.shape-outside"))]
31// #[visit]
32// pub enum ShapeOutsideStyleValue<'a> {}
33
34/// Represents the style value for `shape-image-threshold` as defined in [css-shapes-2](https://drafts.csswg.org/css-shapes-2/#shape-image-threshold).
35///
36/// The shape-outside CSS property, along with shape-margin and shape-image-threshold, sets the shape around which adjacent content will wrap.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// <opacity-value>
42/// ```
43///
44// https://drafts.csswg.org/css-shapes-2/#shape-image-threshold
45#[syntax(" <opacity-value> ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48	initial = "0",
49	applies_to = "floats",
50	inherited = "no",
51	percentages = "n/a",
52	canonical_order = "per grammar",
53	animation_type = "by computed value"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.shape-image-threshold"))]
57#[visit]
58pub struct ShapeImageThresholdStyleValue;
59
60/// Represents the style value for `shape-margin` as defined in [css-shapes-2](https://drafts.csswg.org/css-shapes-2/#shape-margin).
61///
62/// The shape-outside CSS property, along with shape-margin and shape-image-threshold, sets the shape around which adjacent content will wrap.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// <length-percentage [0,∞]>
68/// ```
69///
70// https://drafts.csswg.org/css-shapes-2/#shape-margin
71#[syntax(" <length-percentage [0,∞]> ")]
72#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73#[style_value(
74	initial = "0",
75	applies_to = "floats and initial letter boxes",
76	inherited = "no",
77	percentages = "refer to the inline size of the containing block",
78	canonical_order = "per grammar",
79	animation_type = "by computed value"
80)]
81#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.shape-margin"))]
83#[visit]
84pub struct ShapeMarginStyleValue;
85
86// /// Represents the style value for `shape-inside` as defined in [css-shapes-2](https://drafts.csswg.org/css-shapes-2/#shape-inside).
87// ///
88// /// The grammar is defined as:
89// ///
90// /// ```text,ignore
91// /// auto | outside-shape | [ <basic-shape> || shape-box ] | <image> | display
92// /// ```
93// ///
94// // https://drafts.csswg.org/css-shapes-2/#shape-inside
95// #[syntax(" auto | outside-shape | [ <basic-shape> || shape-box ] | <image> | display ")]
96// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
97// #[style_value(
98// 	initial = "auto",
99//   applies_to = "block-level elements",
100// 	inherited = "no",
101// 	percentages = "n/a",
102// 	canonical_order = "per grammar",
103// 	animation_type = "as defined for <basic-shape>, otherwise discrete",
104// )]
105// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
106// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.shape-inside"))]
107// #[visit]
108// pub enum ShapeInsideStyleValue<'a> {}
109
110/// Represents the style value for `shape-padding` as defined in [css-shapes-2](https://drafts.csswg.org/css-shapes-2/#shape-padding).
111///
112/// The grammar is defined as:
113///
114/// ```text,ignore
115/// <length-percentage [0,∞]>
116/// ```
117///
118// https://drafts.csswg.org/css-shapes-2/#shape-padding
119#[syntax(" <length-percentage [0,∞]> ")]
120#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
121#[style_value(
122	initial = "0",
123	applies_to = "block-level elements",
124	inherited = "no",
125	percentages = "refer to the inline size of the containing block",
126	canonical_order = "per grammar",
127	animation_type = "by computed value"
128)]
129#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
130#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.shape-padding"))]
131#[visit]
132pub struct ShapePaddingStyleValue;