Document this.fromImport for the JS API (#540)

See sass/sass#3055
See webpack-contrib/sass-loader#905
This commit is contained in:
Natalie Weizenbaum 2021-05-17 14:09:17 -07:00 committed by GitHub
parent 9e3a4f6858
commit 35c51fbe33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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",