diff --git a/README.md b/README.md index f56ea1c95..07945a8e7 100644 --- a/README.md +++ b/README.md @@ -277,7 +277,7 @@ X. Exit testing. [implementation-specific expectations]: #implementation-specific-expectations -Any option can also be applied to all future occurences of that type of failure +Any option can also be applied to all future occurrences of that type of failure by adding `!` after it. For example, if you want to mark *all* failing specs as `:todo` for the current implementation you'd type `I!`. diff --git a/spec/core_functions/meta/load_css/error/load.hrx b/spec/core_functions/meta/load_css/error/load.hrx index c4f7fcaa1..37be4229e 100644 --- a/spec/core_functions/meta/load_css/error/load.hrx +++ b/spec/core_functions/meta/load_css/error/load.hrx @@ -34,3 +34,23 @@ Error: Module loop: input.scss is already being loaded. ' _other.scss 2:1 load-css() input.scss 2:1 root stylesheet + +<===> +================================================================================ +<===> top_level_include_declaration/input.scss +@use "sass:meta"; +@include meta.load-css("upstream"); + +<===> top_level_include_declaration/_upstream.scss +@mixin a { b: c } +@include a; + +<===> top_level_include_declaration/error +Error: Declarations may only be used within style rules. + , +1 | @mixin a { b: c } + | ^^^^^ + ' + _upstream.scss 1:12 a() + _upstream.scss 2:1 load-css() + input.scss 2:1 root stylesheet diff --git a/spec/core_functions/meta/load_css/extend.hrx b/spec/core_functions/meta/load_css/extend.hrx index 1cbddd0e1..b04889a63 100644 --- a/spec/core_functions/meta/load_css/extend.hrx +++ b/spec/core_functions/meta/load_css/extend.hrx @@ -104,3 +104,64 @@ a { .target, .extender { a: b; } + +<===> +================================================================================ +<===> nested/README.md +These are regression tests for https://github.com/sass/dart-sass/issues/2588. + +<===> +================================================================================ +<===> nested/without_use/input.scss +@use 'sass:meta'; +.a { + @include meta.load-css('upstream'); +} + +<===> nested/without_use/_upstream.scss +@mixin b { c: d } +@include b; + +<===> nested/without_use/output.css +.a { + c: d; +} + +<===> nested/without_use/warning +DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. +More info and automated migrator: https://sass-lang.com/d/import + , +2 | @import 'upstream'; + | ^^^^^^^^^^ + ' + input.scss 2:11 root stylesheet + +<===> +================================================================================ +<===> nested/with_use/input.scss +@use 'sass:meta'; +.a { + @include meta.load-css('midstream'); +} + +<===> nested/with_use/_midstream.scss +@use 'upstream'; +@mixin b { c: d } +@include b; + +<===> nested/with_use/_upstream.scss +// Intentionally empty. + +<===> nested/with_use/output.css +.a { + c: d; +} + +<===> nested/with_use/warning +DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. +More info and automated migrator: https://sass-lang.com/d/import + , +2 | @import 'upstream'; + | ^^^^^^^^^^ + ' + input.scss 2:11 root stylesheet diff --git a/spec/directives/import/nested.hrx b/spec/directives/import/nested.hrx index b6baf321b..57dcb71e3 100644 --- a/spec/directives/import/nested.hrx +++ b/spec/directives/import/nested.hrx @@ -211,10 +211,10 @@ More info and automated migrator: https://sass-lang.com/d/import /* Y */ <===> with_comment/_b.scss -@import 'a' +@import 'a'; <===> with_comment/_c.scss -@import 'a' +@import 'a'; <===> with_comment/output.css /* Y */ @@ -246,7 +246,7 @@ DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be remo More info and automated migrator: https://sass-lang.com/d/import , -1 | @import 'a' +1 | @import 'a'; | ^^^ ' _b.scss 1:9 @import @@ -257,8 +257,114 @@ DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be remo More info and automated migrator: https://sass-lang.com/d/import , -1 | @import 'a' +1 | @import 'a'; | ^^^ ' _c.scss 1:9 @import input.scss 2:9 root stylesheet + +<===> +================================================================================ +<===> top_level_include_declaration/README.md +These are regression tests for https://github.com/sass/dart-sass/issues/2588. + +<===> +================================================================================ +<===> top_level_include_declaration/without_use/input.scss +.a { + @import 'upstream'; +} + +<===> top_level_include_declaration/without_use/_upstream.scss +@mixin b { c: d } +@include b; + +<===> top_level_include_declaration/without_use/output.css +.a { + c: d; +} + +<===> top_level_include_declaration/without_use/warning +DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. +More info and automated migrator: https://sass-lang.com/d/import + , +2 | @import 'upstream'; + | ^^^^^^^^^^ + ' + input.scss 2:11 root stylesheet + +<===> +================================================================================ +<===> top_level_include_declaration/with_use/input.scss +.a { + @import 'midstream'; +} + +<===> top_level_include_declaration/with_use/_midstream.scss +@use 'upstream'; +@mixin b { c: d } +@include b; + +<===> top_level_include_declaration/with_use/_upstream.scss +// Intentionally empty. + +<===> top_level_include_declaration/with_use/output.css +.a { + c: d; +} + +<===> top_level_include_declaration/with_use/warning +DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. + +More info and automated migrator: https://sass-lang.com/d/import + + , +2 | @import 'midstream'; + | ^^^^^^^^^^^ + ' + input.scss 2:11 root stylesheet + +<===> +================================================================================ +<===> top_level_include_declaration/with_use_two_levels_deep/input.scss +.a { + @import 'midstream1'; +} + +<===> top_level_include_declaration/with_use_two_levels_deep/_midstream1.scss +@import 'midstream2'; + +<===> top_level_include_declaration/with_use_two_levels_deep/_midstream2.scss +@use 'upstream'; +@mixin b { c: d } +@include b; + +<===> top_level_include_declaration/with_use_two_levels_deep/_upstream.scss +// Intentionally empty. + +<===> top_level_include_declaration/with_use_two_levels_deep/output.css +.a { + c: d; +} + +<===> top_level_include_declaration/with_use_two_levels_deep/warning +DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. + +More info and automated migrator: https://sass-lang.com/d/import + + , +2 | @import 'midstream1'; + | ^^^^^^^^^^^^ + ' + input.scss 2:11 root stylesheet + +DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. + +More info and automated migrator: https://sass-lang.com/d/import + + , +1 | @import 'midstream2'; + | ^^^^^^^^^^^^ + ' + _midstream1.scss 1:9 @import + input.scss 2:11 root stylesheet diff --git a/spec/directives/use/error/load.hrx b/spec/directives/use/error/load.hrx index d454ab282..90a90773d 100644 --- a/spec/directives/use/error/load.hrx +++ b/spec/directives/use/error/load.hrx @@ -328,3 +328,40 @@ Error: There's already a module with namespace "other". | ^^^^^^^^^^^^^^^^^^^^^^ new @use ' input.scss 2:1 root stylesheet + +<===> +================================================================================ +<===> top_level_include_declaration/upstream_mixin/input.scss +@use "upstream"; +@include upstream.a; + +<===> top_level_include_declaration/upstream_mixin/_upstream.scss +@mixin a { b: c } + +<===> top_level_include_declaration/upstream_mixin/error +Error: Declarations may only be used within style rules. + , +1 | @mixin a { b: c } + | ^^^^^ + ' + _upstream.scss 1:12 a() + input.scss 2:1 root stylesheet + +<===> +================================================================================ +<===> top_level_include_declaration/input_mixin/input.scss +@use 'upstream'; +@mixin a { b: c } +@include a; + +<===> top_level_include_declaration/input_mixin/_upstream.scss +// Intentionally empty. + +<===> top_level_include_declaration/input_mixin/error +Error: Declarations may only be used within style rules. + , +2 | @mixin a { b: c } + | ^^^^^ + ' + input.scss 2:12 a() + input.scss 3:1 root stylesheet