Skip to content

Commit

Permalink
feat: 增强属性转换
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Jun 11, 2024
1 parent 58f72f1 commit 7827444
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,4 +710,18 @@ describe('aggressiveMode', () => {
transform('class="portrait:(tc w20px)"'),
).toMatchInlineSnapshot('"class=\\"portrait:text-center portrait:w-[20px]\\""')
})
it.only('nth', () => {
expect(
transform('class="children:hover:(w20px bg-red-100)"'),
).toMatchInlineSnapshot('"class=\\"className=\\"children:hover:w20px children:hover:bg-red-100\\"\\""')
expect(
transform('class="first-child:w20px"'),
).toMatchInlineSnapshot('"class=\\"first:[&>*]:w20px\\""')
expect(
transform('class="last-child:w20px"'),
).toMatchInlineSnapshot('"class=\\"last:[&>*]:w20px\\""')
expect(
transform('class="child-(3n+1):w20px"'),
).toMatchInlineSnapshot('"class=\\"[&>*:nth-of-type(3n+1)]:w20px\\""')
})
})

0 comments on commit 7827444

Please sign in to comment.