css_ast/values/color_adjust/
mod.rs

1#![allow(warnings)]
2//! https://drafts.csswg.org/css-color-adjust-1/
3
4mod impls;
5use super::prelude::*;
6use impls::*;
7/// Represents the style value for `color-adjust` as defined in [css-color-adjust-1](https://drafts.csswg.org/css-color-adjust-1/#color-adjust).
8///
9/// 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.
10///
11/// The grammar is defined as:
12///
13/// ```text,ignore
14/// <'print-color-adjust'>
15/// ```
16///
17/// https://drafts.csswg.org/css-color-adjust-1/#color-adjust
18#[syntax(" <'print-color-adjust'> ")]
19#[derive(
20	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
21)]
22#[declaration_metadata(
23    initial = "see individual properties",
24    inherits = Unknown,
25    applies_to = Unknown,
26    percentages = Unknown,
27    animation_type = Unknown,
28    property_group = ColorAdjust,
29    computed_value_type = Unknown,
30    canonical_order = "per grammar",
31)]
32#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
33#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.color-adjust"))]
34#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
35pub struct ColorAdjustStyleValue;
36
37// /// Represents the style value for `color-scheme` as defined in [css-color-adjust-1](https://drafts.csswg.org/css-color-adjust-1/#color-scheme).
38// ///
39// /// 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.
40// ///
41// /// The grammar is defined as:
42// ///
43// /// ```text,ignore
44// /// normal | [ light | dark | <custom-ident> ]+ && only?
45// /// ```
46// ///
47// /// https://drafts.csswg.org/css-color-adjust-1/#color-scheme
48// #[syntax(" normal | [ light | dark | <custom-ident> ]+ && only? ")]
49// #[derive(
50//     Parse,
51//     Peek,
52//     ToSpan,
53//     ToCursors,
54//     DeclarationMetadata,
55//     SemanticEq,
56//     Debug,
57//     Clone,
58//     PartialEq,
59//     Eq,
60//     PartialOrd,
61//     Ord,
62//     Hash,
63// )]
64// #[declaration_metadata(
65//     initial = "normal",
66//     inherits,
67//     applies_to = Elements|Text,
68//     animation_type = Discrete,
69//     property_group = ColorAdjust,
70//     computed_value_type = Unknown,
71//     canonical_order = "per grammar",
72// )]
73// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
74// #[cfg_attr(
75//     feature = "css_feature_data",
76//     derive(ToCSSFeature),
77//     css_feature("css.properties.color-scheme")
78// )]
79// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
80// pub enum ColorSchemeStyleValue<'a> {}
81
82/// 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).
83///
84/// 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.
85///
86/// The grammar is defined as:
87///
88/// ```text,ignore
89/// auto | none | preserve-parent-color
90/// ```
91///
92/// https://drafts.csswg.org/css-color-adjust-1/#forced-color-adjust
93#[syntax(" auto | none | preserve-parent-color ")]
94#[derive(
95	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
96)]
97#[declaration_metadata(
98    initial = "auto",
99    inherits,
100    applies_to = Elements|Text,
101    property_group = ColorAdjust,
102    computed_value_type = AsSpecified,
103    canonical_order = "per grammar",
104)]
105#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
106#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.forced-color-adjust"))]
107#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
108pub enum ForcedColorAdjustStyleValue {}
109
110/// 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).
111///
112/// 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.
113///
114/// The grammar is defined as:
115///
116/// ```text,ignore
117/// economy | exact
118/// ```
119///
120/// https://drafts.csswg.org/css-color-adjust-1/#print-color-adjust
121#[syntax(" economy | exact ")]
122#[derive(
123	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
124)]
125#[declaration_metadata(
126    initial = "economy",
127    inherits,
128    applies_to = Elements,
129    animation_type = Discrete,
130    property_group = ColorAdjust,
131    computed_value_type = Unknown,
132    canonical_order = "per grammar",
133)]
134#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
135#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.print-color-adjust"))]
136#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
137pub enum PrintColorAdjustStyleValue {}