Skip to content
Next Next commit
add failing test
  • Loading branch information
RobinMalfait committed Jan 7, 2025
commit fe95479f1574e318e9a02eee1c36f9e14776dfaa
33 changes: 33 additions & 0 deletions packages/tailwindcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,39 @@ describe('@apply', () => {
}"
`)
})

it('should recursively apply with custom `@utility`, which is used before it is defined', async () => {
expect(
await compileCss(
css`
@tailwind utilities;

@layer base {
body {
@apply my-flex;
}
}

@utility my-flex {
@apply flex;
}
`,
['flex', 'my-flex'],
),
).toMatchInlineSnapshot(`
".flex {
display: flex;
}

@apply flex;

@layer base {
body {
display: flex;
}
}"
`)
})
})

describe('arbitrary variants', () => {
Expand Down