Skip to content

Commit b3d75b2

Browse files
Add currentcolor test
1 parent 6341716 commit b3d75b2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/tailwindcss/src/index.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4950,6 +4950,27 @@ describe('`color-mix(…)` polyfill', () => {
49504950
`)
49514951
})
49524952

4953+
it('uses the first color value as the fallback when the `color-mix(…)` function contains currentcolor', async () => {
4954+
await expect(
4955+
compileCss(
4956+
css`
4957+
@tailwind utilities;
4958+
`,
4959+
['text-current/50'],
4960+
),
4961+
).resolves.toMatchInlineSnapshot(`
4962+
".text-current\\/50 {
4963+
color: currentColor;
4964+
}
4965+
4966+
@supports (color: color-mix(in lab, red, red)) {
4967+
.text-current\\/50 {
4968+
color: color-mix(in oklab, currentColor 50%, transparent);
4969+
}
4970+
}"
4971+
`)
4972+
})
4973+
49534974
it('uses the first color value of the inner most `color-mix(…)` function as the fallback when nested `color-mix(…)` function all contain non-theme variables', async () => {
49544975
await expect(
49554976
compileCss(

0 commit comments

Comments
 (0)