diff --git a/crates/tailwind-parse/src/eval/plugin.rs b/crates/tailwind-parse/src/eval/plugin.rs index 7c7da8d..b5df6f1 100644 --- a/crates/tailwind-parse/src/eval/plugin.rs +++ b/crates/tailwind-parse/src/eval/plugin.rs @@ -187,6 +187,20 @@ lookup_plugin_arbitrary!(max_h, max_height, "maxHeight"); lookup_plugin!(leading, line_height, "lineHeight"); +pub fn align(Value(rest): &Value, _theme: &TailwindTheme) -> Option { + match *rest { + "baseline" => Some(to_lit(&[("verticalAlign", "baseline")])), + "top" => Some(to_lit(&[("verticalAlign", "top")])), + "middle" => Some(to_lit(&[("verticalAlign", "middle")])), + "bottom" => Some(to_lit(&[("verticalAlign", "bottom")])), + "text-top" => Some(to_lit(&[("verticalAlign", "text-top")])), + "text-bottom" => Some(to_lit(&[("verticalAlign", "text-bottom")])), + "sub" => Some(to_lit(&[("verticalAlign", "sub")])), + "super" => Some(to_lit(&[("verticalAlign", "super")])), + _ => None, + } +} + pub fn rounded( subcommand: Option, rest: &Option, diff --git a/crates/tailwind-parse/src/literal.rs b/crates/tailwind-parse/src/literal.rs index 6417204..413f49a 100644 --- a/crates/tailwind-parse/src/literal.rs +++ b/crates/tailwind-parse/src/literal.rs @@ -177,6 +177,7 @@ impl<'a> Literal<'a> { Px => Required(plugin::px), Pl => Required(plugin::pl), Pr => Required(plugin::pr), + VerticalAlign => Required(plugin::align), Py => Required(plugin::py), Pt => Required(plugin::pt), Pb => Required(plugin::pb), diff --git a/crates/tailwind-parse/src/plugin.rs b/crates/tailwind-parse/src/plugin.rs index 287d20e..4b3887a 100644 --- a/crates/tailwind-parse/src/plugin.rs +++ b/crates/tailwind-parse/src/plugin.rs @@ -43,6 +43,8 @@ mod plugin { Pr, Py, Pt, + #[rename("align")] + VerticalAlign, Pb, M, Mx,