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/ddbceaa3cee88f134d557c3051c26fcb5554a535
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, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
82)]
83#[declaration_metadata(
84    initial = "1dppx",
85    inherits,
86    applies_to = Elements,
87    animation_type = Discrete,
88    property_group = Images,
89    computed_value_type = Unknown,
90    canonical_order = "per grammar",
91)]
92#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
93#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.image-resolution"))]
94#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
95#[derive(csskit_derives::NodeWithMetadata)]
96pub struct ImageResolutionStyleValue;
97
98/// Represents the style value for `object-fit` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#object-fit).
99///
100/// The object-fit CSS property sets how images, videos, and other replaced elements are scaled within their container.
101///
102/// The grammar is defined as:
103///
104/// ```text,ignore
105/// fill | none | [contain | cover] || scale-down
106/// ```
107///
108/// https://drafts.csswg.org/css-images-5/#object-fit
109#[syntax(" fill | none | [contain | cover] || scale-down ")]
110#[derive(
111	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
112)]
113#[declaration_metadata(
114    initial = "fill",
115    applies_to = Unknown,
116    animation_type = Discrete,
117    property_group = Images,
118    computed_value_type = Unknown,
119    canonical_order = "per grammar",
120)]
121#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
122#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.object-fit"))]
123#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
124#[derive(csskit_derives::NodeWithMetadata)]
125pub enum ObjectFitStyleValue {}
126
127/// Represents the style value for `object-position` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#object-position).
128///
129/// The object-position CSS property places images, videos, and other replaced elements within their boxes.
130///
131/// The grammar is defined as:
132///
133/// ```text,ignore
134/// <position>
135/// ```
136///
137/// https://drafts.csswg.org/css-images-5/#object-position
138#[syntax(" <position> ")]
139#[derive(
140	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
141)]
142#[declaration_metadata(
143    initial = "50% 50%",
144    applies_to = Unknown,
145    animation_type = Unknown,
146    percentages = SelfSize,
147    property_group = Images,
148    computed_value_type = Unknown,
149    canonical_order = "the horizontal component of the <position>, followed by the vertical component",
150)]
151#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
152#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.object-position"))]
153#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
154#[derive(csskit_derives::NodeWithMetadata)]
155pub struct ObjectPositionStyleValue;
156
157/// Represents the style value for `object-view-box` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#object-view-box).
158///
159/// The object-view-box CSS property crops and zooms to an inset area of an image.
160///
161/// The grammar is defined as:
162///
163/// ```text,ignore
164/// none | <basic-shape-rect>
165/// ```
166///
167/// https://drafts.csswg.org/css-images-5/#object-view-box
168#[syntax(" none | <basic-shape-rect> ")]
169#[derive(
170	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
171)]
172#[declaration_metadata(
173    initial = "none",
174    applies_to = Unknown,
175    animation_type = Discrete,
176    property_group = Images,
177    computed_value_type = Unknown,
178    canonical_order = "per grammar",
179)]
180#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
181#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.object-view-box"))]
182#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
183#[derive(csskit_derives::NodeWithMetadata)]
184pub struct ObjectViewBoxStyleValue;