From f6cdcc8814f1ac8c8e2f8caafa518d5f6258325f Mon Sep 17 00:00:00 2001 From: oyelowo Date: Tue, 10 Oct 2023 12:29:20 -0600 Subject: [PATCH] Support data arbitrary --- tw-macro/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tw-macro/src/lib.rs b/tw-macro/src/lib.rs index 1457907..e56390f 100644 --- a/tw-macro/src/lib.rs +++ b/tw-macro/src/lib.rs @@ -1001,6 +1001,16 @@ fn aria_arbitrary(input: &str) -> IResult<&str, ()> { Ok((input, ())) } +// data-[size=large]:p-8 +fn data_arbitrary(input: &str) -> IResult<&str, ()> { + let (input, _) = tag("data-[")(input)?; + let (input, _) = take_while1(is_ident_char)(input)?; + let (input, _) = tag("=")(input)?; + let (input, _) = take_while1(is_ident_char)(input)?; + let (input, _) = tag("]")(input)?; + Ok((input, ())) +} + // // // @@ -1051,6 +1061,7 @@ fn modifier(input: &str) -> IResult<&str, ()> { predefined_modifier, supports_arbitrary, aria_arbitrary, + data_arbitrary, ))(input) }