Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure color opacity modifiers work with OKLCH colors ([#14741](https://github.com/tailwindlabs/tailwindcss/pull/14741))
- Ensure changes to the input CSS file result in a full rebuild ([#14744](https://github.com/tailwindlabs/tailwindcss/pull/14744))
- Add `postcss` as a dependency of `@tailwindcss/postcss` ([#14750](https://github.com/tailwindlabs/tailwindcss/pull/14750))
- Always emit keyframes registered in `addUtilities` ([#14747](https://github.com/tailwindlabs/tailwindcss/pull/14747))
- Ensure loading stylesheets via the `?raw` and `?url` static asset query works when using the Vite plugin ([#14716](https://github.com/tailwindlabs/tailwindcss/pull/14716))
- _Upgrade (experimental)_: Migrate `flex-grow` to `grow` and `flex-shrink` to `shrink` ([#14721](https://github.com/tailwindlabs/tailwindcss/pull/14721))
- _Upgrade (experimental)_: Minify arbitrary values when printing candidates ([#14720](https://github.com/tailwindlabs/tailwindcss/pull/14720))
Expand Down
1 change: 1 addition & 0 deletions integrations/cli/plugins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ test(
candidate`duration-350`,
'transition-duration: 350ms',
'animation-duration: 350ms',
'@keyframes enter {',
])
},
)
33 changes: 33 additions & 0 deletions packages/tailwindcss/src/compat/plugin-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,39 @@ describe('theme', async () => {
`)
})

test('keyframes added via addUtilities are appended to the AST', async () => {
let input = css`
@tailwind utilities;
@plugin "my-plugin";
`

let compiler = await compile(input, {
loadModule: async (id, base) => {
return {
base,
module: plugin(function ({ addUtilities, theme }) {
addUtilities({
'@keyframes enter': {
from: {
opacity: 'var(--tw-enter-opacity, 1)',
},
},
})
}),
}
},
})

expect(compiler.build([])).toMatchInlineSnapshot(`
"@keyframes enter {
from {
opacity: var(--tw-enter-opacity, 1);
}
}
"
`)
})

test('plugin theme can extend colors', async () => {
let input = css`
@theme reference {
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/src/compat/plugin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function buildPluginApi(

for (let [name, css] of Object.entries(utils)) {
if (name.startsWith('@keyframes ')) {
designSystem.theme.addKeyframes(rule(name, objectToAst(css)))
ast.push(rule(name, objectToAst(css)))
continue
}

Expand Down