Skip to content

Conversation

@RobinMalfait
Copy link
Member

This PR fixes an issue where if you only used @reference that we didn't process Tailwind CSS features.

We have a 'quick bail check', in the PostCSS plugin to quickly bail if we konw that we don't need to handle any Tailwind CSS features. This is useful in Next.js applications where every single CSS file will be passed to the PostCSS plugin.

If you use custom font ins Next.js, each of those fonts will have a CSS file as well.

Before we introduced @reference, we used @import "tailwindcss" reference, which passed the bail check because @import was being used. Now we have @reference which wasn't included in the list.

This is now solved.

Fixes: #16056

Test plan

Added a failing test that is now failing after the fix.

@RobinMalfait RobinMalfait requested a review from a team as a code owner January 30, 2025 12:44
Copy link
Member

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to also handle @variant I think? You can use it with no config for the static variants.

@RobinMalfait
Copy link
Member Author

Needs to also handle @variant I think? You can use it with no config for the static variants.

Ah yep good catch. Added a test and a fix.

@RobinMalfait RobinMalfait enabled auto-merge (squash) January 30, 2025 15:22
@RobinMalfait RobinMalfait merged commit 0d5e2be into main Jan 30, 2025
5 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-16056 branch January 30, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@tailwindcss/postcss does not run on some files that use Tailwind features

3 participants