Skip to content

Commit eeb44e0

Browse files
committed
add failing test
1 parent 608b139 commit eeb44e0

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

packages/tailwindcss/src/index.test.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,40 @@ describe('@apply', () => {
461461
}"
462462
`)
463463
})
464+
465+
it('should recursively apply with custom `@utility`, which is used before it is defined', async () => {
466+
expect(
467+
await compileCss(
468+
css`
469+
@tailwind utilities;
470+
471+
@layer base {
472+
body {
473+
@apply my-flex;
474+
}
475+
}
476+
477+
@utility my-flex {
478+
@apply flex;
479+
/* margin: calc(theme(--spacing) * 4); */
480+
}
481+
`,
482+
['flex', 'my-flex'],
483+
),
484+
).toMatchInlineSnapshot(`
485+
".flex {
486+
display: flex;
487+
}
488+
489+
@apply flex;
490+
491+
@layer base {
492+
body {
493+
display: flex;
494+
}
495+
}"
496+
`)
497+
})
464498
})
465499

466500
describe('arbitrary variants', () => {

0 commit comments

Comments
 (0)