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

Document this.fromImport for the JS API #540

Merged
merged 1 commit into from
May 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/documentation/js-api.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,14 @@ Imports are resolved by trying, in order:
* Each load path specified in the `SASS_PATH` environment variable, which
should be semicolon-separated on Windows and colon-separated elsewhere.

<% impl_status dart: '1.33.0', node: false, feature: "this.fromImport" %>

An importer can determine whether it's being called from an `@import` rule by
checking `this.fromImport`. This should *only* be used for determining whether
or not to load [import-only files].

[import-only files]: https://sass-lang.com/documentation/at-rules/import#import-only-files

```js
sass.render({
file: "style.scss",
Expand Down