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

Fix @apply and CSS functions inside imported files #14576

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

philipp-spiess
Copy link
Member

Part-of #14558

After handling @import of stylesheets in core, we can no longer gate out features based on finding a specific sequence in the input CSS, as this string will not contain contents from other stylesheets.

So, consider the following input CSS:

@import "tailwindcsss";
@import "./styles.css";

We can't opt-out of the traversal to search for @apply based on it because it, of course, does not contain the contents of ./styles.css yet.

@philipp-spiess philipp-spiess marked this pull request as ready for review October 3, 2024 12:41
if (css.includes('@apply')) {
substituteAtApply(ast, designSystem)
}
substituteAtApply(ast, designSystem)
Copy link
Contributor

Choose a reason for hiding this comment

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

I had a feeling we were going to have to do this eventually

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@adamwathan adamwathan force-pushed the fix/at-apply-for-imported-files branch from 2894c2e to 3e0b2c3 Compare October 3, 2024 13:22
@adamwathan adamwathan merged commit aa343a9 into next Oct 3, 2024
1 check passed
@adamwathan adamwathan deleted the fix/at-apply-for-imported-files branch October 3, 2024 13:23
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.

3 participants