From 1238d07ca2cc8ed2145b30aa239a9d1570994cf2 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Thu, 5 Dec 2024 16:18:06 +0100 Subject: [PATCH] Reference imports should not generate utilities (#15307) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We noticed an issue where the new `@import "…" reference` syntax was not throwing away `@tailwind` declarations, effectively causing you to create utility classes whenever you used this feature. This is especially noticed in setups with very strict compilers like Svelte. ## Test Plan ### Before Screenshot 2024-12-05 at 11 56 00 ### After Screenshot 2024-12-05 at 12 27 30 --- CHANGELOG.md | 4 +++- integrations/vite/svelte.test.ts | 11 ++++------ integrations/vite/vue.test.ts | 2 +- packages/tailwindcss/src/index.test.ts | 30 ++++++++++++++++++++++++++ packages/tailwindcss/src/index.ts | 16 +++++++++++--- 5 files changed, 51 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e7e13bff..07fa9c953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +### Fixed + +- Ensure `@import "…" reference` never generates utilities ([#15307](https://github.com/tailwindlabs/tailwindcss/pull/15307)) ## [4.0.0-beta.5] - 2024-12-04 diff --git a/integrations/vite/svelte.test.ts b/integrations/vite/svelte.test.ts index 0f7953c63..3cbfc66fa 100644 --- a/integrations/vite/svelte.test.ts +++ b/integrations/vite/svelte.test.ts @@ -48,7 +48,7 @@ test( target: document.body, }) `, - 'src/index.css': css`@import 'tailwindcss' reference;`, + 'src/index.css': css`@import 'tailwindcss';`, 'src/App.svelte': html`