Skip to content

Commit 00c3517

Browse files
authoredNov 3, 2022
Make `cloneCss() clone modules that transitively contain CSS (#1824)
Previously we were only cloning modules that directly contained CSS, but this created a problem where extensions could be added to their *shared* extension store across `load-css()` boundaries and thereby applied to upstream CSS. Closes #3322
1 parent 44d6bb6 commit 00c3517

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
* Properly mark the warning for passing numbers with units to `random()` as a
5252
deprecation warning.
5353

54+
* Fix a bug where `@extend` could behave unpredicatably when used along with
55+
`meta.load-css()` and shared modules that contained no CSS themselves but
56+
loaded CSS from other modules.
57+
5458
### Dart API
5559

5660
* Emit a deprecation warning when passing a `sassIndex` with units to

‎lib/src/async_environment.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ class _EnvironmentModule implements Module {
10141014
}
10151015

10161016
Module cloneCss() {
1017-
if (css.children.isEmpty) return this;
1017+
if (!transitivelyContainsCss) return this;
10181018

10191019
var newCssAndExtensionStore = cloneCssStylesheet(css, extensionStore);
10201020
return _EnvironmentModule._(

‎lib/src/environment.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_environment.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: 88f81b417129a74e4eb776d518c8e019dbf2ec36
8+
// Checksum: 38c688423116df1e489aa6eafc16de1bf9bc2bf5
99
//
1010
// ignore_for_file: unused_import
1111

@@ -1022,7 +1022,7 @@ class _EnvironmentModule implements Module<Callable> {
10221022
}
10231023

10241024
Module<Callable> cloneCss() {
1025-
if (css.children.isEmpty) return this;
1025+
if (!transitivelyContainsCss) return this;
10261026

10271027
var newCssAndExtensionStore = cloneCssStylesheet(css, extensionStore);
10281028
return _EnvironmentModule._(

0 commit comments

Comments
 (0)
Please sign in to comment.