encre_css/plugins/transform/scale/
mod.rs1#![doc = include_str!("README.md")]
2#![doc(alias = "transform")]
3use crate::{plugins::transform::CSS_TRANSFORM, prelude::build_plugin::*};
4
5type P = (StaticPlugin, StaticPlugin);
6
7const fn plugin(namespace: &'static str, prop: StaticPropertyName) -> P {
8 (
9 Plugin::Number(Number {
10 namespace,
11 prop,
12 has_negative: Some(true),
13 divide_by: Some(100.0),
14 extra_rule_css: Some(&[CSS_TRANSFORM]),
15 ..Number::default()
16 }),
17 Plugin::Arbitrary(Arbitrary {
18 namespace,
19 prop,
20 extra_rule_css: Some(&[CSS_TRANSFORM]),
21 ..Arbitrary::default()
22 }),
23 )
24}
25
26pub(crate) const PLUGIN: P = plugin("scale", MultipleProps(&["--en-scale-x", "--en-scale-y"]));
27pub(crate) const PLUGIN_X: P = plugin("scale-x", SingleProp("--en-scale-x"));
28pub(crate) const PLUGIN_Y: P = plugin("scale-y", SingleProp("--en-scale-y"));
29pub(crate) const PLUGIN_Z: P = plugin("scale-z", SingleProp("--en-scale-z"));