Skip to content
Open
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 @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Canonicalization: don't merge utilities that reference different theme variables set to CSS-wide keywords like `unset` ([#20417](https://github.com/tailwindlabs/tailwindcss/pull/20417))
- Don't generate utilities when a modifier is used that would otherwise be silently ignored (e.g. `rounded-sm/[5]`, `shadow-sm/foo`, `stroke-2/50`) ([#20419](https://github.com/tailwindlabs/tailwindcss/pull/20419))
- Only normalize top-level `and`, `or`, and `not` keywords in `supports-[…]` variants (e.g. `selector(a: not (.foo))` → `selector(a:not(.foo))`) ([#20420](https://github.com/tailwindlabs/tailwindcss/pull/20420))
- Don't crash when a JS config explicitly sets `theme.keyframes` to `null` ([#20425](https://github.com/tailwindlabs/tailwindcss/pull/20425))

## [4.3.3] - 2026-07-16

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,53 @@ test('keyframes can be merged into the theme', () => {
`)
})

test('setting `theme.keyframes` to `null` does not throw and clears keyframes', () => {
let theme = new Theme()
let design = buildDesignSystem(theme)

let { resolvedConfig } = resolveConfig(design, [
{
config: {
theme: {
keyframes: null,
},
},
base: '/root',
reference: false,
src: undefined,
},
])

expect(() => applyKeyframesToTheme(design, resolvedConfig)).not.toThrow()
expect(toCss(design.theme.getKeyframes())).toEqual('')
})
Comment thread
coderabbitai[bot] marked this conversation as resolved.

test('setting `theme.extend.keyframes` to `null` does not throw', () => {
// Unlike a top-level `theme.keyframes: null`, this is a no-op: `deepMerge`
// skips `null`/`undefined` sources entirely, so the resolved value here is
// `{}`, not `null`. This test guards against that assumption changing.
let theme = new Theme()
let design = buildDesignSystem(theme)

let { resolvedConfig } = resolveConfig(design, [
{
config: {
theme: {
extend: {
keyframes: null,
},
},
},
base: '/root',
reference: false,
src: undefined,
},
])

expect(() => applyKeyframesToTheme(design, resolvedConfig)).not.toThrow()
expect(toCss(design.theme.getKeyframes())).toEqual('')
})

test('will append to the default keyframes with new keyframes', () => {
let theme = new Theme()
let design = buildDesignSystem(theme)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function applyKeyframesToTheme(

export function keyframesToRules(resolvedConfig: Pick<ResolvedConfig, 'theme'>): AtRule[] {
let rules: AtRule[] = []
if ('keyframes' in resolvedConfig.theme) {
if (resolvedConfig.theme.keyframes) {
for (let [name, keyframe] of Object.entries(resolvedConfig.theme.keyframes)) {
rules.push(atRule('@keyframes', name, objectToAst(keyframe as any)))
}
Expand Down