Skip to content

Commit 84a6919

Browse files
committed
add @apply with mixin to source map tests
1 parent 83ea878 commit 84a6919

1 file changed

Lines changed: 26 additions & 23 deletions

File tree

packages/tailwindcss/src/source-maps/source-map.test.ts

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ test('@apply generates source maps', async ({ expect }) => {
677677
color: blue;
678678
@apply text-[#000] hover:text-[#f00];
679679
@apply underline;
680+
@apply --my-mixin-1 --my-mixin-2();
680681
color: red;
681682
}
682683
`,
@@ -686,29 +687,31 @@ test('@apply generates source maps', async ({ expect }) => {
686687

687688
expect(annotations).toMatchInlineSnapshot(`
688689
"
689-
output.css | input.css
690-
|
691-
1 .foo { | 1 .foo {
692-
^^^^^ A @ 1:0-5 | ^^^^^ A @ 1:0-5
693-
2 color: blue; | 2 color: blue;
694-
^^^^^^^^^^^ B @ 2:2-13 | ^^^^^^^^^^^ B @ 2:2-13
695-
3 color: #000; | 3 @apply text-[#000] hover:text-[#f00];
696-
^^^^^^^^^^^ C @ 3:2-13 | ^^^^^^^^^^^ C @ 3:9-20
697-
4 &:hover { | 3 @apply text-[#000] hover:text-[#f00];
698-
^^^^^^^^ D @ 4:2-10 | ^^^^^^^^^^^^^^^^^ D @ 3:21-38
699-
5 @media (hover: hover) { |
700-
^^^^^^^^^^^^^^^^^^^^^^ D @ 5:4-26 |
701-
6 color: #f00; |
702-
^^^^^^^^^^^ D @ 6:6-17 |
703-
7 } |
704-
8 } |
705-
9 text-decoration-line: underline; | 4 @apply underline;
706-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E @ 9:2-33 | ^^^^^^^^^ E @ 4:9-18
707-
10 color: red; | 5 color: red;
708-
^^^^^^^^^^ F @ 10:2-12 | ^^^^^^^^^^ F @ 5:2-12
709-
| 6 }
710-
11 } |
711-
12 |
690+
output.css | input.css
691+
|
692+
1 .foo { | 1 .foo {
693+
^^^^^ A @ 1:0-5 | ^^^^^ A @ 1:0-5
694+
2 color: blue; | 2 color: blue;
695+
^^^^^^^^^^^ B @ 2:2-13 | ^^^^^^^^^^^ B @ 2:2-13
696+
3 color: #000; | 3 @apply text-[#000] hover:text-[#f00];
697+
^^^^^^^^^^^ C @ 3:2-13 | ^^^^^^^^^^^ C @ 3:9-20
698+
4 &:hover { | 3 @apply text-[#000] hover:text-[#f00];
699+
^^^^^^^^ D @ 4:2-10 | ^^^^^^^^^^^^^^^^^ D @ 3:21-38
700+
5 @media (hover: hover) { |
701+
^^^^^^^^^^^^^^^^^^^^^^ D @ 5:4-26 |
702+
6 color: #f00; |
703+
^^^^^^^^^^^ D @ 6:6-17 |
704+
7 } |
705+
8 } |
706+
9 text-decoration-line: underline; | 4 @apply underline;
707+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E @ 9:2-33 | ^^^^^^^^^ E @ 4:9-18
708+
10 @apply --my-mixin-1 --my-mixin-2(); | 5 @apply --my-mixin-1 --my-mixin-2();
709+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F @ 10:2-36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F @ 5:2-36
710+
11 color: red; | 6 color: red;
711+
^^^^^^^^^^ G @ 11:2-12 | ^^^^^^^^^^ G @ 6:2-12
712+
| 7 }
713+
12 } |
714+
13 |
712715
"
713716
`)
714717
})

0 commit comments

Comments
 (0)