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