Skip to content

Commit 8a55287

Browse files
authored
Merge pull request #1464 from sass/forward-and-use
Add a regression test for sass/sass#2744
2 parents 544d0ab + ca0393d commit 8a55287

File tree

3 files changed

+69
-41
lines changed

3 files changed

+69
-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+
}

spec/directives/use/with.hrx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,54 @@ c {
280280
d: configured;
281281
}
282282

283+
<===>
284+
================================================================================
285+
<===> through_forward/with_unrelated_config/input.scss
286+
@use "used" with ($from-used: configured);
287+
288+
<===> through_forward/with_unrelated_config/_used.scss
289+
@forward "forwarded";
290+
291+
$from-used: original !default;
292+
293+
a {from-used: $from-used}
294+
295+
<===> through_forward/with_unrelated_config/_forwarded.scss
296+
$from-forwarded: original !default;
297+
b {from-forwarded: $from-forwarded}
298+
299+
<===> through_forward/with_unrelated_config/output.css
300+
b {
301+
from-forwarded: original;
302+
}
303+
304+
a {
305+
from-used: configured;
306+
}
307+
308+
<===>
309+
================================================================================
310+
<===> through_forward/and_use/input.scss
311+
// Regression test for sass/sass#2744.
312+
@use "forwarder" with ($c: e);
313+
314+
a {b: forwarder.$c}
315+
316+
<===> through_forward/and_use/_forwarder.scss
317+
@forward "definition";
318+
@forward "user";
319+
320+
<===> through_forward/and_use/_definition.scss
321+
$c: d !default;
322+
323+
<===> through_forward/and_use/_user.scss
324+
@use "definition";
325+
326+
<===> through_forward/and_use/output.css
327+
a {
328+
b: e;
329+
}
330+
283331
<===>
284332
================================================================================
285333
<===> multi_load/README.md

0 commit comments

Comments
 (0)