Skip to content

Commit 22f4ebf

Browse files
committed
Fix load-css() specs to allow an empty configuration
These specs were wrong. The proposal clearly indicates that empty configurations mean a module is not being configured.
1 parent 340805f commit 22f4ebf

File tree

2 files changed

+21
-41
lines changed

2 files changed

+21
-41
lines changed

spec/core_functions/meta/load_css/error.hrx

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -247,26 +247,6 @@ Error: Built-in module sass:color can't be configured.
247247
The same file can't be configured multiple times, even if the configuration is
248248
identical.
249249

250-
<===>
251-
================================================================================
252-
<===> with/multi_configuration/double_load/empty/input.scss
253-
@use "sass:meta";
254-
255-
// An empty `$with` still counts as a configuration.
256-
@include meta.load-css("other", $with: ());
257-
@include meta.load-css("other", $with: ());
258-
259-
<===> with/multi_configuration/double_load/empty/_other.scss
260-
$a: c !default;
261-
262-
<===> with/multi_configuration/double_load/empty/error
263-
Error: _other.scss was already loaded, so it can't be configured using "with".
264-
,
265-
5 | @include meta.load-css("other", $with: ());
266-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
267-
'
268-
input.scss 5:1 root stylesheet
269-
270250
<===>
271251
================================================================================
272252
<===> with/multi_configuration/double_load/both_configured/input.scss
@@ -328,27 +308,6 @@ Error: This module was already loaded, so it can't be configured using "with".
328308
_midstream.scss 1:1 load-css()
329309
input.scss 3:1 root stylesheet
330310

331-
<===>
332-
================================================================================
333-
<===> with/multi_configuration/use_and_load/empty/input.scss
334-
@use "sass:meta";
335-
336-
@use "other";
337-
338-
// An empty `$with` still counts as a configuration.
339-
@include meta.load-css("other", $with: ());
340-
341-
<===> with/multi_configuration/use_and_load/empty/_other.scss
342-
$a: c !default;
343-
344-
<===> with/multi_configuration/use_and_load/empty/error
345-
Error: _other.scss was already loaded, so it can't be configured using "with".
346-
,
347-
6 | @include meta.load-css("other", $with: ());
348-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
349-
'
350-
input.scss 6:1 root stylesheet
351-
352311
<===>
353312
================================================================================
354313
<===> with/multi_configuration/use_and_load/both_configured/input.scss

spec/core_functions/meta/load_css/with.hrx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,24 @@ $a: original !default;
313313
b {
314314
c: configured;
315315
}
316+
317+
<===>
318+
================================================================================
319+
<===> multi_load/empty/input.scss
320+
@use "sass:meta";
321+
@include meta.load-css("upstream", $with: (a: configured));
322+
323+
// An empty configuration map counts as no configuration.
324+
@include meta.load-css("midstream", $with: ());
325+
326+
<===> multi_load/empty/_midstream.scss
327+
@use "upstream";
328+
b {c: upstream.$a}
329+
330+
<===> multi_load/empty/_upstream.scss
331+
$a: original !default;
332+
333+
<===> multi_load/empty/output.css
334+
b {
335+
c: configured;
336+
}

0 commit comments

Comments
 (0)