css_ast/values/images/
mod.rs

1#![allow(warnings)]
2//! https://drafts.csswg.org/css-images-5/
3
4mod impls;
5use super::prelude::*;
6use impls::*;
7// /// Represents the style value for `image-orientation` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#image-orientation).
8// ///
9// /// The image-orientation CSS property corrects the rotation of an image using the image's metadata, such as EXIF.
10// ///
11// /// The grammar is defined as:
12// ///
13// /// ```text,ignore
14// /// from-image | none | [ <angle> || flip ]
15// /// ```
16// ///
17// /// https://drafts.csswg.org/css-images-5/#image-orientation
18// #[syntax(" from-image | none | [ <angle> || flip ] ")]
19// #[derive(
20//     Parse,
21//     Peek,
22//     ToSpan,
23//     ToCursors,
24//     DeclarationMetadata,
25//     SemanticEq,
26//     Debug,
27//     Clone,
28//     PartialEq,
29//     Eq,
30//     PartialOrd,
31//     Ord,
32//     Hash,
33// )]
34// #[declaration_metadata(
35//     initial = "from-image",
36//     inherits,
37//     applies_to = Elements,
38//     animation_type = Discrete,
39//     property_group = Images,
40//     computed_value_type = Unknown,
41//     canonical_order = "per grammar",
42// )]
43// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
44// #[cfg_attr(
45//     feature = "css_feature_data",
46//     derive(ToCSSFeature),
47//     css_feature("css.properties.image-orientation")
48// )]
49// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
50// pub enum ImageOrientationStyleValue {}
51
52/// Represents the style value for `image-rendering` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#image-rendering).
53///
54/// The image-rendering CSS property sets how images are scaled, retaining smoothness for photos, or hard edges for pixel art and QR codes.
55///
56/// The grammar is defined as:
57///
58/// ```text,ignore
59/// auto | smooth | high-quality | pixelated | crisp-edges
60/// ```
61///
62/// https://drafts.csswg.org/css-images-5/#image-rendering
63#[syntax(" auto | smooth | high-quality | pixelated | crisp-edges ")]
64#[derive(
65	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
66)]
67#[declaration_metadata(
68    initial = "auto",
69    inherits,
70    applies_to = Elements,
71    animation_type = Discrete,
72    property_group = Images,
73    computed_value_type = Unknown,
74    canonical_order = "per grammar",
75)]
76#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
77#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.image-rendering"))]
78#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
79pub enum ImageRenderingStyleValue {}
80
81// /// Represents the style value for `image-resolution` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#image-resolution).
82// ///
83// /// The grammar is defined as:
84// ///
85// /// ```text,ignore
86// /// [ from-image || <resolution> ] && snap?
87// /// ```
88// ///
89// /// https://drafts.csswg.org/css-images-5/#image-resolution
90// #[syntax(" [ from-image || <resolution> ] && snap? ")]
91// #[derive(
92//     Parse,
93//     Peek,
94//     ToSpan,
95//     ToCursors,
96//     DeclarationMetadata,
97//     SemanticEq,
98//     Debug,
99//     Clone,
100//     PartialEq,
101//     Eq,
102//     PartialOrd,
103//     Ord,
104//     Hash,
105// )]
106// #[declaration_metadata(
107//     initial = "1dppx",
108//     inherits,
109//     applies_to = Elements,
110//     animation_type = Discrete,
111//     property_group = Images,
112//     computed_value_type = Unknown,
113//     canonical_order = "per grammar",
114// )]
115// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
116// #[cfg_attr(
117//     feature = "css_feature_data",
118//     derive(ToCSSFeature),
119//     css_feature("css.properties.image-resolution")
120// )]
121// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
122// pub struct ImageResolutionStyleValue;
123
124// /// Represents the style value for `object-fit` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#object-fit).
125// ///
126// /// The object-fit CSS property sets how images, videos, and other replaced elements are scaled within their container.
127// ///
128// /// The grammar is defined as:
129// ///
130// /// ```text,ignore
131// /// fill | none | [contain | cover] || scale-down
132// /// ```
133// ///
134// /// https://drafts.csswg.org/css-images-5/#object-fit
135// #[syntax(" fill | none | [contain | cover] || scale-down ")]
136// #[derive(
137//     Parse,
138//     Peek,
139//     ToSpan,
140//     ToCursors,
141//     DeclarationMetadata,
142//     SemanticEq,
143//     Debug,
144//     Clone,
145//     PartialEq,
146//     Eq,
147//     PartialOrd,
148//     Ord,
149//     Hash,
150// )]
151// #[declaration_metadata(
152//     initial = "fill",
153//     applies_to = Unknown,
154//     animation_type = Discrete,
155//     property_group = Images,
156//     computed_value_type = Unknown,
157//     canonical_order = "per grammar",
158// )]
159// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
160// #[cfg_attr(
161//     feature = "css_feature_data",
162//     derive(ToCSSFeature),
163//     css_feature("css.properties.object-fit")
164// )]
165// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
166// pub enum ObjectFitStyleValue {}
167
168/// Represents the style value for `object-position` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#object-position).
169///
170/// The object-position CSS property places images, videos, and other replaced elements within their boxes.
171///
172/// The grammar is defined as:
173///
174/// ```text,ignore
175/// <position>
176/// ```
177///
178/// https://drafts.csswg.org/css-images-5/#object-position
179#[syntax(" <position> ")]
180#[derive(
181	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
182)]
183#[declaration_metadata(
184    initial = "50% 50%",
185    applies_to = Unknown,
186    percentages = SelfSize,
187    animation_type = Unknown,
188    property_group = Images,
189    computed_value_type = Unknown,
190    canonical_order = "the horizontal component of the <position>, followed by the vertical component",
191)]
192#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
193#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.object-position"))]
194#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
195pub struct ObjectPositionStyleValue;
196
197/// Represents the style value for `object-view-box` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#object-view-box).
198///
199/// The object-view-box CSS property crops and zooms to an inset area of an image.
200///
201/// The grammar is defined as:
202///
203/// ```text,ignore
204/// none | <basic-shape-rect>
205/// ```
206///
207/// https://drafts.csswg.org/css-images-5/#object-view-box
208#[syntax(" none | <basic-shape-rect> ")]
209#[derive(
210	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
211)]
212#[declaration_metadata(
213    initial = "none",
214    applies_to = Unknown,
215    animation_type = Discrete,
216    property_group = Images,
217    computed_value_type = Unknown,
218    canonical_order = "per grammar",
219)]
220#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
221#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.object-view-box"))]
222#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
223pub struct ObjectViewBoxStyleValue;