css_ast/values/color/
mod.rs

1#![allow(warnings)]
2//! https://drafts.csswg.org/css-color-6/
3
4mod impls;
5use super::prelude::*;
6use impls::*;
7/// Represents the style value for `color` as defined in [css-color-6](https://drafts.csswg.org/css-color-6/#color).
8///
9/// The color CSS property sets the primary foreground color of an element, which is used for text, the default border color, and text decorations.
10///
11/// The grammar is defined as:
12///
13/// ```text,ignore
14/// <color>
15/// ```
16///
17/// https://drafts.csswg.org/css-color-6/#color
18#[syntax(" <color> ")]
19#[derive(
20	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
21)]
22#[declaration_metadata(
23    initial = "CanvasText",
24    inherits,
25    applies_to = Elements|Text,
26    animation_type = ByComputedValue,
27    property_group = Color,
28    computed_value_type = Unknown,
29    canonical_order = "per grammar",
30)]
31#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
32#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.color"))]
33#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
34pub struct ColorStyleValue;
35
36/// Represents the style value for `opacity` as defined in [css-color-6](https://drafts.csswg.org/css-color-6/#opacity).
37///
38/// The opacity CSS property sets the transparency of an element.
39///
40/// The grammar is defined as:
41///
42/// ```text,ignore
43/// <opacity-value>
44/// ```
45///
46/// https://drafts.csswg.org/css-color-6/#opacity
47#[syntax(" <opacity-value> ")]
48#[derive(
49	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
50)]
51#[declaration_metadata(
52    initial = "1",
53    applies_to = Elements,
54    percentages = NormalizedRange,
55    animation_type = ByComputedValue,
56    property_group = Color,
57    computed_value_type = Unknown,
58    canonical_order = "per grammar",
59)]
60#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
61#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.opacity"))]
62#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
63pub struct OpacityStyleValue;