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 partial specs for loading CSS with @use #1357

Merged
merged 2 commits into from
Mar 11, 2019
Merged

Add partial specs for loading CSS with @use #1357

merged 2 commits into from
Mar 11, 2019

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Mar 11, 2019

This doesn't specify the interaction between @use and @import, since
sass/sass#75 is unresolved.

[skip dart-sass]

a {
file: midstream;
}

Copy link

Choose a reason for hiding this comment

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

Why is @import "input.css"; above the a {file: midstream} in the output 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.

CSS @imports are required to appear before any other rules (other than @charset) in the document. All these import_order tests ensure that we maintain that invariant while hewing as closely as possible to the original source order.


@import "midstream2.css";

/* input comment before use */
Copy link

Choose a reason for hiding this comment

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

Why do the "before use" comments appear after the contents of the @use file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be very complicated to keep track of which comments appeared above or between which @use rules in the source text and use that to interpolate them appropriately into the CSS, especially once you get into multiple @uses of the same module. The next best thing is just to keep the contents of an individual file together as much as possible (with the caveat that CSS @imports are split out).

@nex3 nex3 merged commit fec05ad into feature.use Mar 11, 2019
@nex3 nex3 deleted the use.css branch March 11, 2019 23:50
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