File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1010
1111* Deprecate passing non-` deg ` units to ` color.hwb() ` 's ` $hue ` argument.
1212
13+ ### Dart API
14+
15+ * Add a top-level ` fakeFromImport() ` function for testing custom importers
16+ that use ` AsyncImporter.fromImport ` .
17+
1318### JS API
1419
1520* Add a ` charset ` option that controls whether or not Sass emits a
1621 ` @charset ` /BOM for non-ASCII stylesheets.
22+
1723* Fix Sass npm package types for TS 4.7+ Node16 and NodeNext module resolution.
1824
1925## 1.53.0
Original file line number Diff line number Diff line change 55/// We strongly recommend importing this library with the prefix `sass` .
66library sass;
77
8+ import 'package:meta/meta.dart' ;
89import 'package:package_config/package_config_types.dart' ;
910import 'package:source_maps/source_maps.dart' ;
1011
@@ -15,6 +16,7 @@ import 'src/compile_result.dart';
1516import 'src/exception.dart' ;
1617import 'src/import_cache.dart' ;
1718import 'src/importer.dart' ;
19+ import 'src/importer/utils.dart' ;
1820import 'src/logger.dart' ;
1921import 'src/syntax.dart' ;
2022import 'src/util/nullable.dart' ;
@@ -474,3 +476,10 @@ Future<String> compileStringAsync(
474476 result.sourceMap.andThen (sourceMap);
475477 return result.css;
476478}
479+
480+ /// Runs [callback] in a context where [AsyncImporter.fromImport] returns
481+ /// `true` .
482+ ///
483+ /// This is only intended for use when testing custom importers.
484+ @visibleForTesting
485+ T fakeFromImport <T >(T callback ()) => inImportRule (callback);
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import '../io.dart';
1717/// removed, at which point we can delete this and have one consistent behavior.
1818bool get fromImport => Zone .current[#_inImportRule] as bool ? ?? false ;
1919
20- /// Runs [callback] in a context where [inImportRule ] returns `true` and
20+ /// Runs [callback] in a context where [fromImport ] returns `true` and
2121/// [resolveImportPath] uses `@import` semantics rather than `@use` semantics.
2222T inImportRule <T >(T callback ()) =>
2323 runZoned (callback, zoneValues: {#_inImportRule: true });
You can’t perform that action at this time.
0 commit comments