tailwind_css_fixes/modules/borders/divide/divide_style/
mod.rs1use super::*;
2
3#[derive(Clone, Debug)]
4pub struct TailwindDivideStyle {
5 kind: String,
6}
7
8impl From<&str> for TailwindDivideStyle {
9 fn from(style: &str) -> Self {
11 Self { kind: style.to_string() }
12 }
13}
14
15impl Display for TailwindDivideStyle {
16 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
17 write!(f, "divide-{}", self.kind)
18 }
19}
20
21impl TailwindInstance for TailwindDivideStyle {
22 fn inlineable(&self) -> bool {
23 false
25 }
26
27 fn attributes(&self, _: &TailwindBuilder) -> CssAttributes {
28 let inner_attrs = css_attributes! {
30 "--tw-border-style" => self.kind.clone(),
32 "border-style" => self.kind.clone()
33 };
34
35 let mut top_level_attrs = CssAttributes::default();
37
38 let selector = ":where(& > :not(:last-child))".to_string();
40 top_level_attrs.insert_nested(selector, inner_attrs);
41
42 top_level_attrs
43 }
44}