Skip to content

Commit

Permalink
feat: support highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Aug 1, 2024
1 parent c6de3cb commit a5a0155
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
"type": "boolean",
"default": false,
"description": "After turning on aggressive mode, it will be more abbreviated, such as t1 -> top-1"
},
"tailwindMagic.highlight": {
"type": "boolean",
"default": true,
"description": "match tailwindcss synatx will have underline"
}
}
},
Expand Down
14 changes: 13 additions & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ describe('aggressiveMode', () => {
).toMatchInlineSnapshot(`"class="gap-y-1""`)
})

it('tc | tl | tr | te | tj | ts | tw | fs | fe | fb | fa | fev', () => {
it('tc | tl | tr | te | tj | ts | tw | fs | fe | fb | fa | fev | fl | fr | fls | fle', () => {
expect(
transform('className={`w-full py-2 shrink-0 whitespace-nowrap text-ellipsis text-center ${tab === i ? \'bg-primary text-white\' : \'\'}`}'),
).toMatchInlineSnapshot('"className={`w-full py-2 shrink-0 whitespace-nowrap text-ellipsis text-center ${tab === i ? \'bg-primary text-white\' : \'\'}`}"')
Expand Down Expand Up @@ -632,6 +632,18 @@ describe('aggressiveMode', () => {
expect(
transform('class="fev"'),
).toMatchInlineSnapshot(`"class="flex justify-evenly""`)
expect(
transform('class="fl"'),
).toMatchInlineSnapshot(`"class="float-left""`)
expect(
transform('class="fr"'),
).toMatchInlineSnapshot(`"class="float-right""`)
expect(
transform('class="fls"'),
).toMatchInlineSnapshot(`"class="float-start""`)
expect(
transform('class="fle"'),
).toMatchInlineSnapshot(`"class="float-end""`)
})

it('wrap:', () => {
Expand Down

0 comments on commit a5a0155

Please sign in to comment.