sass 1.87.0 → 1.88.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  */
7
7
  export interface Deprecations {
8
8
  // START AUTOGENERATED LIST
9
- // Checksum: 3639e60773866019c018ae16267c8f23e4df86cf
9
+ // Checksum: c57ab2eb07ab1df48581b8484ef9bdbad0ddceaa
10
10
 
11
11
  /**
12
12
  * Deprecation for passing a string directly to meta.call().
@@ -169,6 +169,13 @@ export interface Deprecations {
169
169
  */
170
170
  'type-function': Deprecation<'type-function'>;
171
171
 
172
+ /**
173
+ * Deprecation for passing a relative url to compileString().
174
+ *
175
+ * This deprecation became active in Dart Sass 1.88.0.
176
+ */
177
+ 'compile-string-relative-url': Deprecation<'compile-string-relative-url'>;
178
+
172
179
  // END AUTOGENERATED LIST
173
180
 
174
181
  /**
@@ -226,12 +226,13 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
226
226
  * the same result. Calling {@link canonicalize} with a URL returned by a
227
227
  * previous call to {@link canonicalize} must return that URL.
228
228
  *
229
- * Relative loads in stylesheets loaded from an importer are handled by
230
- * resolving the loaded URL relative to the canonical URL of the stylesheet
231
- * that contains it, and passing that URL back to the importer's {@link
232
- * canonicalize} method. For example, suppose the "Resolving a Load" example
233
- * {@link Importer | above} returned a stylesheet that contained `@use
234
- * "mixins"`:
229
+ * #### Relative URLs
230
+ *
231
+ * Relative loads in stylesheets loaded from an importer are first resolved
232
+ * relative to the canonical URL of the stylesheet that contains it and passed
233
+ * back to the {@link canonicalize} method for the local importer that loaded
234
+ * that stylesheet. For example, suppose the "Resolving a Load" example {@link
235
+ * Importer | above} returned a stylesheet that contained `@use "mixins"`:
235
236
  *
236
237
  * - The compiler resolves the URL `mixins` relative to the current
237
238
  * stylesheet's canonical URL `db:foo/bar/baz/_index.scss` to get
@@ -243,6 +244,11 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
243
244
  * called with a URL relative to one returned by an earlier call to {@link
244
245
  * canonicalize}.
245
246
  *
247
+ * If the local importer's `canonicalize` method returns `null`, the relative
248
+ * URL is then passed to each of {@link Options.importers}' `canonicalize()`
249
+ * methods in turn until one returns a canonical URL. If none of them do, the
250
+ * load fails.
251
+ *
246
252
  * @param url - The loaded URL. Since this might be relative, it's represented
247
253
  * as a string rather than a {@link URL} object.
248
254
  *
@@ -231,8 +231,25 @@ export interface Options<sync extends 'sync' | 'async'> {
231
231
  *
232
232
  * Loads are resolved by trying, in order:
233
233
  *
234
- * - The importer that was used to load the current stylesheet, with the
235
- * loaded URL resolved relative to the current stylesheet's canonical URL.
234
+ * - **For relative URLs only:** the URL resolved relative to the current
235
+ * stylesheet's canonical URL, passed to the importer that loaded the current
236
+ * stylesheet.
237
+ *
238
+ * When calling {@link compileString} or {@link compileStringAsync}, the
239
+ * entrypoint file isn't "loaded" in the same sense as other files. In that
240
+ * case:
241
+ *
242
+ * - {@link StringOptions.url} is the canonical URL and {@link
243
+ * StringOptions.importer} is the importer that loaded it.
244
+ *
245
+ * - If {@link StringOptions.importer} isn't passed and {@link
246
+ * StringOptions.url} is a `file:` URL, the URL is loaded from the
247
+ * filesystem by default. (You can disable this by passing `{canonicalize:
248
+ * url => null}` as {@link StringOptions.importer}.)
249
+ *
250
+ * - If {@link StringOptions.url} isn't passed but {@link
251
+ * StringOptions.importer} is, the relative URL is passed to {@link
252
+ * StringOptions.importer} as-is.
236
253
  *
237
254
  * - Each {@link Importer}, {@link FileImporter}, or
238
255
  * {@link NodePackageImporter} in {@link importers}, in order.
@@ -390,8 +407,8 @@ export interface Options<sync extends 'sync' | 'async'> {
390
407
  *
391
408
  * If the {@link StringOptions.importer} field isn't passed, the entrypoint file
392
409
  * can load files relative to itself if a `file://` URL is passed to the {@link
393
- * url} field. If it is passed, the entrypoint file uses it to load files
394
- * relative to itself.
410
+ * url} field. If `importer` is passed, the entrypoint file uses that importer
411
+ * to load files relative to itself.
395
412
  *
396
413
  * @typeParam sync - This lets the TypeScript checker verify that asynchronous
397
414
  * {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
@@ -411,13 +428,11 @@ export interface StringOptions<sync extends 'sync' | 'async'>
411
428
  syntax?: Syntax;
412
429
 
413
430
  /**
414
- * The importer to use to handle loads that are relative to the entrypoint
415
- * stylesheet.
431
+ * The importer to use to handle relative URL loads in the entrypoint
432
+ * stylesheet and stylesheets loaded relative to the entrypoint stylesheet.
416
433
  *
417
- * A relative load's URL is first resolved relative to {@link url}, then
418
- * passed to {@link importer}. (It's passed as-is if {@link url} isn't
419
- * passed.) If the importer doesn't recognize it, it's then passed to {@link
420
- * importers} and {@link loadPaths}.
434
+ * See {@link Options.importers} for details on how loads are resolved for the
435
+ * entrypoint stylesheet.
421
436
  *
422
437
  * @category Input
423
438
  */
@@ -426,10 +441,8 @@ export interface StringOptions<sync extends 'sync' | 'async'>
426
441
  /**
427
442
  * The canonical URL of the entrypoint stylesheet.
428
443
  *
429
- * A relative load's URL is first resolved relative to {@link url}, then
430
- * resolved to a file on disk if it's a `file://` URL. If it can't be resolved
431
- * to a file on disk, it's then passed to {@link importers} and {@link
432
- * loadPaths}.
444
+ * See {@link Options.importers} for details on how loads are resolved for the
445
+ * entrypoint stylesheet.
433
446
  *
434
447
  * @category Input
435
448
  * @compatibility feature: "Undefined URL with importer", dart: "1.75.0", node: false