Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Only generate positive `grid-cols-*` and `grid-rows-*` utilities ([#16020](https://github.com/tailwindlabs/tailwindcss/pull/16020))
- Ensure we process Tailwind CSS features when only using `@reference` ([#16057](https://github.com/tailwindlabs/tailwindcss/pull/16057))

## [4.0.1] - 2025-01-29

Expand Down
27 changes: 27 additions & 0 deletions packages/@tailwindcss-postcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,33 @@ test('bail early when Tailwind is not used', async () => {
`)
})

test('handle CSS when only using a `@reference` (we should not bail early)', async () => {
let processor = postcss([
tailwindcss({ base: `${__dirname}/fixtures/example-project`, optimize: { minify: false } }),
])

let result = await processor.process(
css`
@reference "tailwindcss/theme.css";

foo {
@variant md {
bar: baz;
}
}
`,
{ from: inputCssFilePath() },
)

expect(result.css.trim()).toMatchInlineSnapshot(`
"@media (width >= 48rem) {
foo {
bar: baz;
}
}"
`)
})

test('runs `Once` plugins in the right order', async () => {
let before = ''
let after = ''
Expand Down
1 change: 1 addition & 0 deletions packages/@tailwindcss-postcss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
root.walkAtRules((node) => {
if (
node.name === 'import' ||
node.name === 'reference' ||
node.name === 'theme' ||
node.name === 'config' ||
node.name === 'plugin' ||
Expand Down