From d1878ff318c9448120637f6815fb7d78826ad5bf Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Wed, 11 Aug 2021 16:18:22 -0700 Subject: [PATCH] Add specs for a couple @extend bugs See sass/dart-sass#1393 --- .../use/extend/optional_and_mandatory.hrx | 34 ++++++++++++++++--- spec/directives/use/extend/upstream.hrx | 17 ++++++++++ 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/spec/directives/use/extend/optional_and_mandatory.hrx b/spec/directives/use/extend/optional_and_mandatory.hrx index c9ad23aaa3..c66251d226 100644 --- a/spec/directives/use/extend/optional_and_mandatory.hrx +++ b/spec/directives/use/extend/optional_and_mandatory.hrx @@ -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; } diff --git a/spec/directives/use/extend/upstream.hrx b/spec/directives/use/extend/upstream.hrx index 56b5f8eb18..27c38eef93 100644 --- a/spec/directives/use/extend/upstream.hrx +++ b/spec/directives/use/extend/upstream.hrx @@ -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; +}