tailwind_css/traits/
mod.rs1use std::{
2 cmp::Ordering,
3 fmt::{Debug, Display, Formatter},
4 hash::{Hash, Hasher},
5};
6
7use crate::{CssAttributes, TailwindBuilder};
8
9pub mod instance;
10
11#[allow(unused_variables)]
12pub trait TailwindInstance: Display {
13 #[inline]
15 fn id(&self) -> String {
16 self.to_string()
17 }
18 fn inlineable(&self) -> bool {
20 true
21 }
22 fn boxed(self) -> Box<dyn TailwindInstance>
24 where
25 Self: Sized,
26 Self: 'static,
27 {
28 Box::new(self)
29 }
30 fn selectors(&self, ctx: &TailwindBuilder) -> String {
32 format!(".{}", self.id())
33 }
34 fn attributes(&self, ctx: &TailwindBuilder) -> CssAttributes;
36 fn additional(&self, ctx: &TailwindBuilder) -> String {
38 String::new()
39 }
40}