Skip to content

Commit

Permalink
Support data arbitrary
Browse files Browse the repository at this point in the history
  • Loading branch information
Oyelowo committed Oct 10, 2023
1 parent 3cbfed2 commit f6cdcc8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tw-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, ()))
}

//
//
//
Expand Down Expand Up @@ -1051,6 +1061,7 @@ fn modifier(input: &str) -> IResult<&str, ()> {
predefined_modifier,
supports_arbitrary,
aria_arbitrary,
data_arbitrary,
))(input)
}

Expand Down

0 comments on commit f6cdcc8

Please sign in to comment.