Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure we process Tailwind CSS features when using @reference #16057

Merged
merged 6 commits into from
Jan 30, 2025

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
CHANGELOG.md Outdated Show resolved Hide resolved
@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
2 participants