leptos_css/
color_adjust.rs1use std::fmt;
2
3use crate::checked_value::impl_checked_value;
4use crate::serialization::CssWriteTo;
5
6#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
10#[non_exhaustive]
11pub enum ForcedColorAdjust {
12 Auto,
14 None,
16 PreserveParentColor,
18}
19
20impl CssWriteTo for ForcedColorAdjust {
21 fn css_fmt<W: fmt::Write>(&self, w: &mut W) -> fmt::Result {
22 w.write_str(match self {
23 Self::Auto => "auto",
24 Self::None => "none",
25 Self::PreserveParentColor => "preserve-parent-color",
26 })
27 }
28}
29
30#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
34#[non_exhaustive]
35pub enum PrintColorAdjust {
36 Economy,
38 Exact,
40}
41
42impl CssWriteTo for PrintColorAdjust {
43 fn css_fmt<W: fmt::Write>(&self, w: &mut W) -> fmt::Result {
44 w.write_str(match self {
45 Self::Economy => "economy",
46 Self::Exact => "exact",
47 })
48 }
49}
50
51impl_checked_value!(ForcedColorAdjust, PrintColorAdjust);