tailwind_css_fixes/modules/layouts/placement/
left.rs

1use super::*;
2
3#[doc=include_str!("readme.md")]
4#[derive(Clone, Debug)]
5pub struct TailwindLeft {
6    kind: UnitValue,
7}
8
9impl Display for TailwindLeft {
10    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
11        self.kind.write_negative(f)?;
12        self.kind.write_class(f, "left-")
13    }
14}
15
16impl TailwindInstance for TailwindLeft {
17    fn attributes(&self, _: &TailwindBuilder) -> CssAttributes {
18        css_attributes! {
19            "left" => self.kind.get_properties_rem()
20        }
21    }
22}
23
24impl TailwindLeft {
25    /// <https://tailwindcss.com/docs/top-right-bottom-left>
26    pub fn parse(pattern: &[&str], arbitrary: &TailwindArbitrary, negative: Negative) -> Result<Self> {
27        let kind = get_kind_px_full_auto_fract("left", pattern, arbitrary, negative)?;
28        Ok(Self { kind })
29    }
30    /// <https://developer.mozilla.org/en-US/docs/Web/CSS/left#syntax>
31    pub fn check_valid(mode: &str) -> bool {
32        check_valid_auto(mode)
33    }
34}