tailwind_css_fixes/systems/units/length_only/
traits.rs

1use super::*;
2
3impl From<LengthUnit> for UnitValue {
4    fn from(n: LengthUnit) -> Self {
5        Self::Length(n)
6    }
7}
8
9impl From<&str> for UnitValue {
10    fn from(s: &str) -> Self {
11        Self::Keyword(s.to_string())
12    }
13}
14
15impl From<String> for UnitValue {
16    fn from(s: String) -> Self {
17        Self::Keyword(s)
18    }
19}
20
21impl From<TailwindArbitrary> for UnitValue {
22    fn from(a: TailwindArbitrary) -> Self {
23        Self::Arbitrary(a)
24    }
25}
26
27impl From<&TailwindArbitrary> for UnitValue {
28    fn from(a: &TailwindArbitrary) -> Self {
29        Self::Arbitrary(a.clone())
30    }
31}
32
33impl From<i32> for UnitValue {
34    fn from(n: i32) -> Self {
35        Self::Number { n: n as f32, is_negative: n < 0 }
36    }
37}