css_ast/values/contain/mod.rs
1#![allow(warnings)]
2//! CSS Containment Module Level 2
3//! https://drafts.csswg.org/css-contain-4/
4
5mod impls;
6use impls::*;
7
8// /// Represents the style value for `contain` as defined in [css-contain-4](https://drafts.csswg.org/css-contain-4/#contain).
9// ///
10// /// The contain CSS property sets limits to the scope of styles, layout, and paint rendering for speed and efficiency. The none keyword value disables containment, strict is equivalent to contain: size layout style paint, and content is equivalent to contain: layout style paint.
11// ///
12// /// The grammar is defined as:
13// ///
14// /// ```text,ignore
15// /// none | strict | content | [ [size | inline-size] || layout || style || paint ]
16// /// ```
17// ///
18// // https://drafts.csswg.org/css-contain-4/#contain
19// #[syntax(" none | strict | content | [ [size | inline-size] || layout || style || paint ] ")]
20// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21// #[style_value(
22// initial = "none",
23// applies_to = "See below",
24// inherited = "no",
25// percentages = "n/a",
26// canonical_order = "per grammar",
27// animation_type = "not animatable",
28// )]
29// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.contain"))]
31// #[visit]
32// pub enum ContainStyleValue {}
33
34/// Represents the style value for `content-visibility` as defined in [css-contain-4](https://drafts.csswg.org/css-contain-4/#content-visibility).
35///
36/// The content-visibility CSS property delays rendering an element, including layout and painting, until it is needed.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// visible | auto | hidden
42/// ```
43///
44// https://drafts.csswg.org/css-contain-4/#content-visibility
45#[syntax(" visible | auto | hidden ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48 initial = "visible",
49 applies_to = "elements for which size containment can apply",
50 inherited = "no",
51 percentages = "n/a",
52 canonical_order = "per grammar",
53 animation_type = "see § 4.1 animating and interpolating content-visibility"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.content-visibility"))]
57#[visit]
58pub enum ContentVisibilityStyleValue {}