From 0dce34244865551b9c4c97f19f41fecc087cb36b Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Wed, 19 Feb 2025 23:52:02 +0100 Subject: [PATCH] Add change log --- CHANGELOG.md | 7 ++++--- packages/tailwindcss/src/ast.ts | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7143ff1b106..801ba2584482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - _Experimental_: Add `user-valid` and `user-invalid` variants ([#12370](https://github.com/tailwindlabs/tailwindcss/pull/12370)) +### Changed + +- Don't include theme variables that aren't used in compiled CSS ([#16211](https://github.com/tailwindlabs/tailwindcss/pull/16211), [#16676](https://github.com/tailwindlabs/tailwindcss/pull/16676)) + ### Fixed - Remove invalid `!important` on CSS variable declarations ([#16668](https://github.com/tailwindlabs/tailwindcss/pull/16668)) @@ -43,9 +47,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Revert change to no longer include theme variables that aren't used in compiled CSS ([#16403](https://github.com/tailwindlabs/tailwindcss/pull/16403)) - -### Fixed - - Upgrade: Don't migrate `blur` to `blur-sm` when used with Next.js `` ([#16405](https://github.com/tailwindlabs/tailwindcss/pull/16405)) ## [4.0.5] - 2025-02-08 diff --git a/packages/tailwindcss/src/ast.ts b/packages/tailwindcss/src/ast.ts index f0110de70aae..36194d9f41fc 100644 --- a/packages/tailwindcss/src/ast.ts +++ b/packages/tailwindcss/src/ast.ts @@ -490,13 +490,13 @@ export function optimizeAst( continue next } } + } - // Remove unused keyframes - for (let keyframe of keyframes) { - if (!usedKeyframeNames.has(keyframe.params)) { - let idx = atRoots.indexOf(keyframe) - atRoots.splice(idx, 1) - } + // Remove unused keyframes + for (let keyframe of keyframes) { + if (!usedKeyframeNames.has(keyframe.params)) { + let idx = atRoots.indexOf(keyframe) + atRoots.splice(idx, 1) } }