tailwind_css_fixes/systems/units/axis/
mod.rs

1use super::*;
2
3///
4#[derive(Copy, Clone, Debug)]
5pub struct SpacingAxis {
6    class: &'static str,
7    attributes: &'static [&'static str],
8}
9
10impl Display for SpacingAxis {
11    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
12        write!(f, "{}", self.class)
13    }
14}
15
16impl SpacingAxis {
17    ///
18    pub fn new(class: &'static str, attributes: &'static [&'static str]) -> Self {
19        Self { class, attributes }
20    }
21
22    pub fn write_attributes(&self, css: &mut CssAttributes, value: String) {
23        for attribute in self.attributes {
24            css.insert(attribute.to_string(), value.to_string());
25        }
26    }
27}