Skip to content

Commit

Permalink
Document this.fromImport for the JS API (sass#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
Israel-4Ever authored May 17, 2021
1 parent ee524b6 commit f5eacf2
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit f5eacf2

Please sign in to comment.