Skip to main content

css_ast/values/images/
mod.rs

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