css_ast/values/view_transitions/
mod.rs

1#![allow(warnings)]
2//! CSS View Transitions Module Level 2
3//! https://drafts.csswg.org/css-view-transitions-2/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `view-transition-name` as defined in [css-view-transitions-2](https://drafts.csswg.org/css-view-transitions-2/#view-transition-name).
9///
10/// View transitions allow you to create animated visual transitions between different states of a document.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// none | <custom-ident>
16/// ```
17///
18// https://drafts.csswg.org/css-view-transitions-2/#view-transition-name
19#[syntax(" none | <custom-ident> ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22	initial = "none",
23	applies_to = "all elements",
24	inherited = "no",
25	percentages = "n/a",
26	canonical_order = "per grammar",
27	animation_type = "discrete"
28)]
29#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.view-transition-name"))]
31#[visit]
32pub struct ViewTransitionNameStyleValue;
33
34/// Represents the style value for `view-transition-class` as defined in [css-view-transitions-2](https://drafts.csswg.org/css-view-transitions-2/#view-transition-class).
35///
36/// The view-transition-class CSS property sets a name that can be used to apply styles to multiple named view transition pseudo-elements.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// none | <custom-ident>+
42/// ```
43///
44// https://drafts.csswg.org/css-view-transitions-2/#view-transition-class
45#[syntax(" none | <custom-ident>+ ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48	initial = "none",
49	applies_to = "all elements",
50	inherited = "no",
51	percentages = "n/a",
52	canonical_order = "per grammar",
53	animation_type = "discrete"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.view-transition-class"))]
57#[visit]
58pub struct ViewTransitionClassStyleValue<'a>;
59
60/// Represents the style value for `view-transition-group` as defined in [css-view-transitions-2](https://drafts.csswg.org/css-view-transitions-2/#view-transition-group).
61///
62/// The grammar is defined as:
63///
64/// ```text,ignore
65/// normal | contain | nearest | <custom-ident>
66/// ```
67///
68// https://drafts.csswg.org/css-view-transitions-2/#view-transition-group
69#[syntax(" normal | contain | nearest | <custom-ident> ")]
70#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
71#[style_value(
72	initial = "normal",
73	applies_to = "all elements",
74	inherited = "no",
75	percentages = "n/a",
76	canonical_order = "per grammar",
77	animation_type = "discrete"
78)]
79#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
80#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.view-transition-group"))]
81#[visit]
82pub enum ViewTransitionGroupStyleValue {}