1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use super::*;
#[doc = include_str!("readme.md")]
#[derive(Debug, Clone)]
pub struct TailwindIndent {
    kind: Indent,
}
#[derive(Debug, Clone)]
enum Indent {
    Unit(f32),
    Length(LengthUnit),
}
impl Display for TailwindIndent {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match &self.kind {
            Indent::Unit(n) => write!(f, "indent-{}", n),
            Indent::Length(n) => write!(f, "indent-{}", n.get_class()),
        }
    }
}
impl TailwindInstance for TailwindIndent {
    fn attributes(&self, _: &TailwindBuilder) -> BTreeSet<CssAttribute> {
        let indent = match &self.kind {
            Indent::Unit(n) => format!("{}rem", n / 4.0),
            Indent::Length(n) => n.get_properties(),
        };
        css_attributes! {
            "text-indent" => indent
        }
    }
}
impl TailwindIndent {
    pub fn parse(pattern: &[&str], arbitrary: &TailwindArbitrary) -> Result<Self> {
        todo!()
    }
}