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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
use super::*;
impl Display for TailwindFontSmoothing {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let text = match self {
Self::Normal => "antialiased",
Self::Subpixel => "subpixel-antialiased",
};
f.write_str(text)
}
}
impl TailwindInstance for TailwindFontSmoothing {
fn attributes(&self, _: &TailwindBuilder) -> BTreeSet<CssAttribute> {
match self {
Self::Normal => css_attributes! {
"-webkit-font-smoothing" => "antialiased",
"-moz-osx-font-smoothing" => "grayscale",
},
Self::Subpixel => css_attributes! {
"-webkit-font-smoothing" => "auto",
"-moz-osx-font-smoothing" => "auto",
},
}
}
}
impl Display for TailwindFontFamily {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
todo!()
}
}
impl TailwindInstance for TailwindFontFamily {}
impl Display for TailwindFontSize {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
todo!()
}
}
impl TailwindInstance for TailwindFontSize {}
impl Display for TailwindFontWeight {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let text = match self.weight {
100 => "thin",
_ => return write!(f, "font-[{}]", self.weight),
};
write!(f, "font-{}", text)
}
}
impl TailwindInstance for TailwindFontWeight {
fn attributes(&self, _: &TailwindBuilder) -> BTreeSet<CssAttribute> {
Iterator::collect(IntoIterator::into_iter([CssAttribute::new("font-weight", &self.weight.to_string())]))
}
}
impl Display for TailwindTextAlignment {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
todo!()
}
}
impl TailwindInstance for TailwindTextAlignment {}
impl Display for TailwindTextColor {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
todo!()
}
}
impl TailwindInstance for TailwindTextColor {}