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

Add support for arbitrary modifiers after @import #1695

Merged
merged 3 commits into from May 19, 2022
Merged

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented May 18, 2022

@nex3 nex3 requested a review from jathak May 18, 2022 22:08
lib/src/ast/sass/interpolation.dart Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@nex3 nex3 force-pushed the import-modifiers branch 2 times, most recently from 6cc90d9 to 3bd4b0f Compare May 18, 2022 23:23
@@ -21,5 +21,8 @@ class SupportsAnything implements SupportsCondition {

SupportsAnything(this.contents, this.span);

Interpolation toInterpolation() =>
Interpolation.concat(['(', contents, ')'], span);
Copy link
Contributor

Choose a reason for hiding this comment

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

is it actually equivalent in case a CalculationExpression is present in it ? We have a special handling for calculations in supports conditions, that would be lost here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good catch. Instead of converting these to interpolation, I've added an expression-level AST node just for this.

whitespace();
} else {
whitespace();
if (scanner.scanChar($comma)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This support for comma looks incompatible with using the comma as separator between multiple ImportArgument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually exists to match the previous behavior: because MediaQueryList can contain commas at nearly any point, you could already write @import "..." foo, bar, baz. This just makes it more explicit.

@nex3 nex3 merged commit fa0d2fb into main May 19, 2022
@nex3 nex3 deleted the import-modifiers branch May 19, 2022 23:53
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.

None yet

3 participants