Skip to content

Commit

Permalink
Add specs for a couple @extend bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Aug 11, 2021
1 parent 7b107bc commit d1878ff
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
34 changes: 29 additions & 5 deletions spec/directives/use/extend/optional_and_mandatory.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,48 @@ in-other, in-input {

<===>
================================================================================
<===> different_files/input.scss
<===> different_files/optional_first/input.scss
@use "optional";
@use "mandatory";

<===> different_files/_optional.scss
<===> different_files/optional_first/_optional.scss
@use "shared";

downstream {@extend in-other !optional};

<===> different_files/_mandatory.scss
<===> different_files/optional_first/_mandatory.scss
@use "shared";

downstream {@extend in-other};

<===> different_files/_shared.scss
<===> different_files/optional_first/_shared.scss
in-other {x: y}

<===> different_files/output.css
<===> different_files/optional_first/output.css
in-other, downstream {
x: y;
}

<===>
================================================================================
<===> different_files/mandatory_first/input.scss
@use "mandatory";
@use "optional";

<===> different_files/mandatory_first/_optional.scss
@use "shared";

downstream {@extend in-other !optional};

<===> different_files/mandatory_first/_mandatory.scss
@use "shared";

downstream {@extend in-other};

<===> different_files/mandatory_first/_shared.scss
in-other {x: y}

<===> different_files/mandatory_first/output.css
in-other, downstream {
x: y;
}
17 changes: 17 additions & 0 deletions spec/directives/use/extend/upstream.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,20 @@ in-input {@extend %in-other}
in-input {
x: y;
}

<===>
================================================================================
<===> double/input.scss
// Regression test for sass/dart-sass#1393
@use "other";

downstream {@extend upstream}

<===> double/_other.scss
upstream {a: b}
downstream {@extend upstream}

<===> double/output.css
upstream, downstream {
a: b;
}

0 comments on commit d1878ff

Please sign in to comment.