tailwindcss/packages
Philipp Spiess d6c4e72351
Add @reference "…" (#15565)
This PR adds a new `@reference "…"` API as an replacement for the
previously added [`@import "…"
reference`](https://github.com/tailwindlabs/tailwindcss/pull/15228). The
motivation for a distinct at rule is that `@import` is already handled
outside of Tailwind in some scenarios (e.g. when using in combination
with postcss-import, other pre-processors, or frameworks like Svelte).
While our implementation of hijacking the `media` attribute _works in
this cases_, it can cause annoying linter issues because tooling build
around `@import` does not know about our behavior.

To fix this, we've decided to move this mode into a separate at rule
that is passed-through in the other tooling. Here's an example of how
this would look like in Svelte:

```svelte
<h1>Hello world!</h1>

<style>
  @reference './theme.css';
  h1 {
    color: var(--theme-color);
  }
</style>
```

With this change, the Svelte linter would not be detecting unused CSS
from the `theme.css` file as it would if we'd rely on `@import`.
2025-01-07 15:41:43 +00:00
..
@tailwindcss-browser Add @tailwindcss/browser package (#15558) 2025-01-07 09:57:34 -05:00
@tailwindcss-cli Prepare v4.0.0-beta.8 release (#15418) 2024-12-17 13:31:28 +01:00
@tailwindcss-node Update jiti 2.4.0 → 2.4.2 (patch) (#15491) 2025-01-06 11:42:53 +01:00
@tailwindcss-postcss Move --container-prose to --max-width-prose (#15439) 2024-12-18 20:15:37 -05:00
@tailwindcss-standalone Update bun 1.1.40 → 1.1.42 (patch) (#15551) 2025-01-06 12:45:16 +01:00
@tailwindcss-upgrade Upgrade: Do not extract class names from functions (#15566) 2025-01-07 15:31:48 +01:00
@tailwindcss-vite Prepare v4.0.0-beta.8 release (#15418) 2024-12-17 13:31:28 +01:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss Add @reference "…" (#15565) 2025-01-07 15:41:43 +00:00
tsconfig.base.json Improve debug logs (#15303) 2024-12-11 15:27:20 +01:00