Skip to content

Commit

Permalink
add test for @theme static
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Feb 7, 2025
1 parent b735291 commit dc7aee8
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions packages/tailwindcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,55 @@ describe('Parsing themes values from CSS', () => {
`)
})

test('keyframes are generated when used in an animation using `@theme static`', async () => {
expect(
await compileCss(
css`
@theme static {
--animate-foo: used 1s infinite;
--animate-bar: unused-but-kept 1s infinite;
@keyframes used {
to {
opacity: 1;
}
}
@keyframes unused-but-kept {
to {
opacity: 0;
}
}
}
@tailwind utilities;
`,
['animate-foo'],
),
).toMatchInlineSnapshot(`
":root, :host {
--animate-foo: used 1s infinite;
--animate-bar: unused-but-kept 1s infinite;
}
.animate-foo {
animation: var(--animate-foo);
}
@keyframes used {
to {
opacity: 1;
}
}
@keyframes unused-but-kept {
to {
opacity: 0;
}
}"
`)
})

test('keyframes are generated when used in user CSS', async () => {
expect(
await compileCss(
Expand Down

0 comments on commit dc7aee8

Please sign in to comment.