css_ast 0.0.25

CSS Abstract Syntax Trees with visitable nodes and style value types.
Documentation
// AUTO-GENERATED from w3c/csswg-drafts
// Commit: https://github.com/w3c/csswg-drafts/commit/4a2d33ef63e58de3f090c0efc69a038c5c4c1527
// Do not edit this file directly.
#![allow(warnings)]
//! https://drafts.csswg.org/css-images-5/

mod impls;
use super::prelude::*;
use impls::*;
/// Represents the style value for `image-orientation` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#image-orientation).
///
/// The image-orientation CSS property corrects the rotation of an image using the image's metadata, such as EXIF.
///
/// The grammar is defined as:
///
/// ```text,ignore
/// from-image | none | [ <angle> || flip ]
/// ```
///
/// https://drafts.csswg.org/css-images-5/#image-orientation
#[syntax(" from-image | none | [ <angle> || flip ] ")]
#[derive(
	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
)]
#[declaration_metadata(
    initial = "from-image",
    inherits,
    applies_to = Elements,
    animation_type = Discrete,
    property_group = Images,
    computed_value_type = Unknown,
    canonical_order = "per grammar",
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.image-orientation"))]
#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
#[derive(csskit_derives::NodeWithMetadata)]
pub enum ImageOrientationStyleValue {}

/// Represents the style value for `image-rendering` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#image-rendering).
///
/// The image-rendering CSS property sets how images are scaled, retaining smoothness for photos, or hard edges for pixel art and QR codes.
///
/// The grammar is defined as:
///
/// ```text,ignore
/// auto | smooth | high-quality | pixelated | crisp-edges
/// ```
///
/// https://drafts.csswg.org/css-images-5/#image-rendering
#[syntax(" auto | smooth | high-quality | pixelated | crisp-edges ")]
#[derive(
	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
)]
#[declaration_metadata(
    initial = "auto",
    inherits,
    applies_to = Elements,
    animation_type = Discrete,
    property_group = Images,
    computed_value_type = Unknown,
    canonical_order = "per grammar",
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.image-rendering"))]
#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
#[derive(csskit_derives::NodeWithMetadata)]
pub enum ImageRenderingStyleValue {}

/// Represents the style value for `image-resolution` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#image-resolution).
///
/// The grammar is defined as:
///
/// ```text,ignore
/// [ from-image || <resolution> ] && snap?
/// ```
///
/// https://drafts.csswg.org/css-images-5/#image-resolution
#[syntax(" [ from-image || <resolution> ] && snap? ")]
#[derive(
	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
)]
#[declaration_metadata(
    initial = "1dppx",
    inherits,
    applies_to = Elements,
    animation_type = Discrete,
    property_group = Images,
    computed_value_type = Unknown,
    canonical_order = "per grammar",
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.image-resolution"))]
#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
#[derive(csskit_derives::NodeWithMetadata)]
pub struct ImageResolutionStyleValue;

/// Represents the style value for `object-fit` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#object-fit).
///
/// The object-fit CSS property sets how images, videos, and other replaced elements are scaled within their container.
///
/// The grammar is defined as:
///
/// ```text,ignore
/// fill | none | [contain | cover] || scale-down
/// ```
///
/// https://drafts.csswg.org/css-images-5/#object-fit
#[syntax(" fill | none | [contain | cover] || scale-down ")]
#[derive(
	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
)]
#[declaration_metadata(
    initial = "fill",
    applies_to = Unknown,
    animation_type = Discrete,
    property_group = Images,
    computed_value_type = Unknown,
    canonical_order = "per grammar",
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.object-fit"))]
#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
#[derive(csskit_derives::NodeWithMetadata)]
pub enum ObjectFitStyleValue {}

/// Represents the style value for `object-position` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#object-position).
///
/// The object-position CSS property places images, videos, and other replaced elements within their boxes.
///
/// The grammar is defined as:
///
/// ```text,ignore
/// <position>
/// ```
///
/// https://drafts.csswg.org/css-images-5/#object-position
#[syntax(" <position> ")]
#[derive(
	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
)]
#[declaration_metadata(
    initial = "50% 50%",
    applies_to = Unknown,
    animation_type = Unknown,
    percentages = SelfSize,
    property_group = Images,
    computed_value_type = Unknown,
    canonical_order = "the horizontal component of the <position>, followed by the vertical component",
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.object-position"))]
#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
#[derive(csskit_derives::NodeWithMetadata)]
pub struct ObjectPositionStyleValue;

/// Represents the style value for `object-view-box` as defined in [css-images-5](https://drafts.csswg.org/css-images-5/#object-view-box).
///
/// The object-view-box CSS property crops and zooms to an inset area of an image.
///
/// The grammar is defined as:
///
/// ```text,ignore
/// none | <basic-shape-rect>
/// ```
///
/// https://drafts.csswg.org/css-images-5/#object-view-box
#[syntax(" none | <basic-shape-rect> ")]
#[derive(
	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
)]
#[declaration_metadata(
    initial = "none",
    applies_to = Unknown,
    animation_type = Discrete,
    property_group = Images,
    computed_value_type = Unknown,
    canonical_order = "per grammar",
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.object-view-box"))]
#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
#[derive(csskit_derives::NodeWithMetadata)]
pub struct ObjectViewBoxStyleValue;