encre_css/plugins/typography/content/
mod.rs

1#![doc = include_str!("README.md")]
2#![doc(alias = "typography")]
3use crate::prelude::build_plugin::*;
4
5#[derive(Debug)]
6pub(crate) struct PluginDefinition;
7
8impl Plugin for PluginDefinition {
9    fn can_handle(&self, context: ContextCanHandle) -> bool {
10        match context.modifier {
11            Modifier::Builtin { value, .. } => *value == "none",
12            Modifier::Arbitrary { value, .. } => is_matching_all(value),
13        }
14    }
15
16    fn handle(&self, context: &mut ContextHandle) {
17        match context.modifier {
18            Modifier::Builtin { .. } => {
19                context.buffer.line(format_args!("--en-content: none;"));
20            }
21            Modifier::Arbitrary { value, .. } => {
22                context.buffer.line(format_args!("--en-content: {value};"));
23            }
24        }
25    }
26}