Skip to content

Tests for fix to crash when mixin @import and @use #2060

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Goodwine
Copy link
Member

@Goodwine Goodwine commented Jul 2, 2025

[skip dart-sass]

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's also worth testing the meta.load-css() equivalent to the nested import case, since that should produce an error.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean that:

.foo {
  @include meta.load-css('upstream');
}

Should throw an error, when this does not?

.foo {
  @import 'upstream';
}

Because it actually throws an error, but I don't think it should 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

but if it should, then we're all set :P

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it should. meta.load-css() loads the module as a module, which means that its CSS is generated context-independently and only afterwards injected into the document. A stylesheet loaded as a module shouldn't allow top-level declarations, because that's not valid CSS.

@Goodwine Goodwine force-pushed the import-use-crash branch 2 times, most recently from 3ef0074 to 327f20f Compare July 17, 2025 01:39
@Goodwine Goodwine requested a review from nex3 July 17, 2025 02:12
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.

2 participants