tailwind_css/modules/typography/text/
mod.rs1use super::*;
2
3pub(crate) mod text_align;
4pub(crate) mod text_color;
5pub(crate) mod text_overflow;
6pub(crate) mod text_transform;
7
8pub fn text_adaptor(pattern: &[&str], arbitrary: &TailwindArbitrary) -> Result<Box<dyn TailwindInstance>> {
9 let out = match pattern {
10 [s @ ("left" | "center" | "right" | "justify" | "start" | "end")] => TailwindTextAlignment::from(*s).boxed(),
12 ["align", rest @ ..] => TailwindTextAlignment::parse(rest, arbitrary)?.boxed(),
13 [s @ ("ellipsis" | "clip")] => TailwindTextAlignment::from(*s).boxed(),
15 ["overflow", rest @ ..] => TailwindTextAlignment::parse(rest, arbitrary)?.boxed(),
16 ["transform", rest @ ..] => TailwindTextTransform::parse(rest, arbitrary)?.boxed(),
18 [s @ ("xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl")] =>
20 TailwindFontSize::new(s).boxed(),
21 _ => {
23 let color = TailwindColor::parse(pattern, arbitrary)?;
24 TailwindTextColor::from(color).boxed()
25 },
26 };
27 Ok(out)
28}