css_ast/values/color_adjust/mod.rs
1#![allow(warnings)]
2//! CSS Color Adjustment Module Level 1
3//! https://drafts.csswg.org/css-color-adjust-1/
4
5mod impls;
6use impls::*;
7
8// /// Represents the style value for `color-scheme` as defined in [css-color-adjust-1](https://drafts.csswg.org/css-color-adjust-1/#color-scheme).
9// ///
10// /// The color-scheme CSS property sets which color schemes (light or dark) an element uses and may prevent automatic dark mode adjustments by the browser.
11// ///
12// /// The grammar is defined as:
13// ///
14// /// ```text,ignore
15// /// normal | [ light | dark | <custom-ident> ]+ && only?
16// /// ```
17// ///
18// // https://drafts.csswg.org/css-color-adjust-1/#color-scheme
19// #[syntax(" normal | [ light | dark | <custom-ident> ]+ && only? ")]
20// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21// #[style_value(
22// initial = "normal",
23// applies_to = "all elements and text",
24// inherited = "yes",
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.color-scheme"))]
31// #[visit]
32// pub enum ColorSchemeStyleValue<'a> {}
33
34/// Represents the style value for `forced-color-adjust` as defined in [css-color-adjust-1](https://drafts.csswg.org/css-color-adjust-1/#forced-color-adjust).
35///
36/// The forced-colors CSS @media rule detects when a user has chosen to use a forced colors mode, also known as high-contrast mode, and the forced-color-adjust CSS property sets whether forced colors apply to an element.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// auto | none | preserve-parent-color
42/// ```
43///
44// https://drafts.csswg.org/css-color-adjust-1/#forced-color-adjust
45#[syntax(" auto | none | preserve-parent-color ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48 initial = "auto",
49 applies_to = "all elements and text",
50 inherited = "yes",
51 percentages = "n/a",
52 canonical_order = "per grammar",
53 animation_type = "not animatable"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.forced-color-adjust"))]
57#[visit]
58pub enum ForcedColorAdjustStyleValue {}
59
60/// Represents the style value for `print-color-adjust` as defined in [css-color-adjust-1](https://drafts.csswg.org/css-color-adjust-1/#print-color-adjust).
61///
62/// The print-color-adjust CSS property sets whether styles of printed pages should be adjusted to use less ink, in cases such as light text on a dark background.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// economy | exact
68/// ```
69///
70// https://drafts.csswg.org/css-color-adjust-1/#print-color-adjust
71#[syntax(" economy | exact ")]
72#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73#[style_value(
74 initial = "economy",
75 applies_to = "all elements",
76 inherited = "yes",
77 percentages = "n/a",
78 canonical_order = "per grammar",
79 animation_type = "discrete"
80)]
81#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.print-color-adjust"))]
83#[visit]
84pub enum PrintColorAdjustStyleValue {}
85
86/// Represents the style value for `color-adjust` as defined in [css-color-adjust-1](https://drafts.csswg.org/css-color-adjust-1/#color-adjust).
87///
88/// The color-adjust shorthand CSS property allows multiple performance related color adjustments to be set at once. Setting the print-color-adjust CSS property directly is preferred, as it is the only such adjustment so far defined.
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// <'print-color-adjust'>
94/// ```
95///
96// https://drafts.csswg.org/css-color-adjust-1/#color-adjust
97#[syntax(" <'print-color-adjust'> ")]
98#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99#[style_value(
100 initial = "see individual properties",
101 applies_to = "see individual properties",
102 inherited = "see individual properties",
103 percentages = "see individual properties",
104 canonical_order = "per grammar",
105 animation_type = "see individual properties"
106)]
107#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
108#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.color-adjust"))]
109#[visit]
110pub struct ColorAdjustStyleValue;