From c095071f2202fd68783e1a2fbcded277694ae7d6 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Sat, 3 May 2025 00:48:45 +0200 Subject: [PATCH] Skip `.css` files when migrating templates (#17854) This PR fixes an issue where the upgrade tool also migrates `.css` files as-if they are content files. This is not the intended behavior. ## Test plan Ran this on my personal website. Before: image After: image --- CHANGELOG.md | 2 +- packages/@tailwindcss-upgrade/src/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3de214458..a8982c4b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Upgrade: Automatically convert candidates with arbitrary values to their utilities ([#17831](https://github.com/tailwindlabs/tailwindcss/pull/17831)) +- Upgrade: Automatically convert candidates with arbitrary values to their utilities ([#17831](https://github.com/tailwindlabs/tailwindcss/pull/17831), [#17854](https://github.com/tailwindlabs/tailwindcss/pull/17854)) ### Fixed diff --git a/packages/@tailwindcss-upgrade/src/index.ts b/packages/@tailwindcss-upgrade/src/index.ts index ed802a2e0..c6a7e2250 100644 --- a/packages/@tailwindcss-upgrade/src/index.ts +++ b/packages/@tailwindcss-upgrade/src/index.ts @@ -283,6 +283,7 @@ async function run() { let scanner = new Scanner({ sources }) let filesToMigrate = [] for (let file of scanner.files) { + if (file.endsWith('.css')) continue if (seenFiles.has(file)) continue seenFiles.add(file) filesToMigrate.push(file)