Skip to content

Commit

Permalink
Revert: Only expose used CSS variables (#16403)
Browse files Browse the repository at this point in the history
This reverts #16211

We found some unexpected interactions with using `@apply` and CSS
variables in multi-root setups like CSS modules or Vue inline `<style>`
blocks that were broken due to that change. We plan to re-enable this
soon and include a proper fix for those scenarios.

## Test plan

- Updated snapshots
- Tested using the CLI in a new project:
<img width="1523" alt="Screenshot 2025-02-10 at 13 08 42"
src="https://github.com/user-attachments/assets/defe0858-adb3-4d61-9d2c-87166558fd68"
/>

---------

Co-authored-by: Robin Malfait <[email protected]>
  • Loading branch information
philipp-spiess and RobinMalfait authored Feb 10, 2025
1 parent 1f84241 commit 9bbe2e3
Show file tree
Hide file tree
Showing 21 changed files with 1,473 additions and 123 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ jobs:
- name: Build Tailwind CSS
run: pnpm run build
env:
FEATURES_ENV: stable

- name: Run pre-publish optimizations scripts
run: node ./scripts/pre-publish-optimizations.mjs
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ jobs:
- name: Build Tailwind CSS
run: pnpm run build
env:
FEATURES_ENV: stable

- name: Run pre-publish optimizations scripts
run: node ./scripts/pre-publish-optimizations.mjs
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

Nothing yet!
### Fixed

- Revert change to no longer include theme variables that aren't used in compiled CSS

## [4.0.5] - 2025-02-08

Expand Down
4 changes: 3 additions & 1 deletion integrations/cli/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,9 @@ test(
expect(await fs.dumpFiles('./dist/*.css')).toMatchInlineSnapshot(`
"
--- ./dist/out.css ---
<EMPTY>
:root, :host {
--color-blue-500: blue;
}
"
`)

Expand Down
383 changes: 383 additions & 0 deletions packages/@tailwindcss-postcss/src/__snapshots__/index.test.ts.snap

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions packages/@tailwindcss-postcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ test('runs `Once` plugins in the right order', async () => {
)

expect(result.css.trim()).toMatchInlineSnapshot(`
".custom-css {
":root, :host {
--color-red-500: red;
}
.custom-css {
color: red;
}"
`)
Expand All @@ -343,7 +347,11 @@ test('runs `Once` plugins in the right order', async () => {
}"
`)
expect(after).toMatchInlineSnapshot(`
".custom-css {
":root, :host {
--color-red-500: red;
}
.custom-css {
color: red;
}"
`)
Expand Down
Loading

0 comments on commit 9bbe2e3

Please sign in to comment.