Skip to content

Fix @apply and CSS functions inside imported files#14576

Merged
adamwathan merged 5 commits into
nextfrom
fix/at-apply-for-imported-files
Oct 3, 2024
Merged

Fix @apply and CSS functions inside imported files#14576
adamwathan merged 5 commits into
nextfrom
fix/at-apply-for-imported-files

Conversation

@philipp-spiess

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
@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
@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