Struct tailwind_parse::Directive
source · pub struct Directive<'a> {
pub exps: Vec<Expression<'a>>,
}
Expand description
A directive is a list of expressions separated by one or more spaces.
An example is: bg-red-500 text-white
Fields§
§exps: Vec<Expression<'a>>
Implementations§
source§impl<'a> Directive<'a>
impl<'a> Directive<'a>
sourcepub fn parse(
s: NomSpan<'a>
) -> (NomSpan<'a>, Self, Vec<LocatedSpan<&str, Span>>)
pub fn parse(
s: NomSpan<'a>
) -> (NomSpan<'a>, Self, Vec<LocatedSpan<&str, Span>>)
Same as parse, but with an added check for an EOF.
sourcepub fn to_literal(
self,
config: &'a TailwindConfig<'_>
) -> (ObjectLit, Vec<ExpressionConversionError<'a>>)
pub fn to_literal(
self,
config: &'a TailwindConfig<'_>
) -> (ObjectLit, Vec<ExpressionConversionError<'a>>)
Attempts to parse a literal from the given directive,