diff --git a/crates/tailwind-parse/src/eval/plugin.rs b/crates/tailwind-parse/src/eval/plugin.rs index be9fbb6..8578c9c 100644 --- a/crates/tailwind-parse/src/eval/plugin.rs +++ b/crates/tailwind-parse/src/eval/plugin.rs @@ -714,6 +714,10 @@ pub fn justify(Value(rest): &Value, _theme: &TailwindTheme) -> Option .map(|v| to_lit(&[("justifyContent", v)])) } +pub fn italic() -> Option { + Some(to_lit(&[("fontStyle", "italic")])) +} + pub fn items(Value(rest): &Value, _theme: &TailwindTheme) -> Option { match *rest { "start" => Some("flex-start"), diff --git a/crates/tailwind-parse/src/literal.rs b/crates/tailwind-parse/src/literal.rs index ff4da42..42a1970 100644 --- a/crates/tailwind-parse/src/literal.rs +++ b/crates/tailwind-parse/src/literal.rs @@ -47,6 +47,7 @@ impl<'a> LiteralConversionError<'a> { } enum PluginType { + Singular(fn() -> Option), Required(fn(&Value, &TailwindTheme) -> Option), Optional(fn(Option<&Value>, &TailwindTheme) -> Option), RequiredArbitrary(fn(&SubjectValue, &TailwindTheme) -> Option), @@ -147,6 +148,7 @@ impl<'a> Literal<'a> { Grow => Optional(plugin::grow), Shrink => Optional(plugin::shrink), Basis => Required(plugin::basis), + Italic => Singular(plugin::italic), Justify => Required(plugin::justify), Items => Required(plugin::items), Gap(None) => Required(plugin::gap), @@ -209,6 +211,7 @@ impl<'a> Literal<'a> { (Optional(p), None) => p(None, theme), (RequiredArbitrary(p), Some(value)) => p(value, theme), (OptionalArbitrary(p), value) => p(value.as_ref(), theme), + (Singular(p), None) => p(), _ => None, } .ok_or_else(|| LiteralConversionError::new(self.cmd, self.value)) diff --git a/crates/tailwind-parse/src/plugin.rs b/crates/tailwind-parse/src/plugin.rs index 91bed9a..2cbd779 100644 --- a/crates/tailwind-parse/src/plugin.rs +++ b/crates/tailwind-parse/src/plugin.rs @@ -107,6 +107,7 @@ mod plugin { Space, Transform, Opacity, + Italic, Blur, Ring, Sr, @@ -123,6 +124,7 @@ mod plugin { #[derive(Copy, Clone, Eq, PartialEq, Debug)] pub enum Not { Prose, + Italic, } #[derive(Copy, Clone, Eq, PartialEq, Debug)]