From beaf75ab57f6afde59811ec3306c72b009c2774c Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Fri, 5 Jun 2020 13:01:35 -0700 Subject: [PATCH] Refactor `@content` arguments specs --- .../mixin/content/arguments/error.hrx} | 150 ++++++++++++++++-- .../mixin/content/arguments/none.hrx | 105 ++++++++++++ .../mixin/content/arguments/passing.hrx | 97 +++++++++++ .../mixin/content/arguments/receiving.hrx | 148 +++++++++++++++++ .../mixin/content/arguments/scope.hrx | 74 +++++++++ .../mixin/content/arguments/syntax.hrx | 98 ++++++++++++ .../mixin/content/error.hrx} | 8 +- .../mixin/content/arguments/error/syntax.hrx | 117 -------------- .../mixin/content/arguments/none.hrx | 67 -------- .../mixin/content/arguments/passing.hrx | 84 ---------- .../mixin/content/arguments/receiving.hrx | 145 ----------------- .../mixin/content/arguments/scope.hrx | 35 ---- .../mixin/content/arguments/weird_syntax.hrx | 81 ---------- 13 files changed, 661 insertions(+), 548 deletions(-) rename spec/{non_conformant/mixin/content/arguments/error/args.hrx => directives/mixin/content/arguments/error.hrx} (52%) create mode 100644 spec/directives/mixin/content/arguments/none.hrx create mode 100644 spec/directives/mixin/content/arguments/passing.hrx create mode 100644 spec/directives/mixin/content/arguments/receiving.hrx create mode 100644 spec/directives/mixin/content/arguments/scope.hrx create mode 100644 spec/directives/mixin/content/arguments/syntax.hrx rename spec/{non_conformant/mixin/error/no_content.hrx => directives/mixin/content/error.hrx} (71%) delete mode 100644 spec/non_conformant/mixin/content/arguments/error/syntax.hrx delete mode 100644 spec/non_conformant/mixin/content/arguments/none.hrx delete mode 100644 spec/non_conformant/mixin/content/arguments/passing.hrx delete mode 100644 spec/non_conformant/mixin/content/arguments/receiving.hrx delete mode 100644 spec/non_conformant/mixin/content/arguments/scope.hrx delete mode 100644 spec/non_conformant/mixin/content/arguments/weird_syntax.hrx diff --git a/spec/non_conformant/mixin/content/arguments/error/args.hrx b/spec/directives/mixin/content/arguments/error.hrx similarity index 52% rename from spec/non_conformant/mixin/content/arguments/error/args.hrx rename to spec/directives/mixin/content/arguments/error.hrx index 50a2daa8f0..02bee681a7 100644 --- a/spec/non_conformant/mixin/content/arguments/error/args.hrx +++ b/spec/directives/mixin/content/arguments/error.hrx @@ -1,4 +1,4 @@ -<===> none_passed/input.scss +<===> args/none_passed/input.scss // It's an error to pass no arguments to a content block that requires them. @mixin mixin { @content; @@ -6,7 +6,7 @@ @include mixin using ($arg1, $arg2) {} -<===> none_passed/error +<===> args/none_passed/error Error: Missing argument $arg1. , 3 | @content; @@ -19,7 +19,7 @@ Error: Missing argument $arg1. input.scss 3:3 mixin() input.scss 6:1 root stylesheet -<===> none_passed/error-libsass +<===> args/none_passed/error-libsass Error: Mixin @content is missing argument $arg1. on line 2:3 of test.scss, in mixin `mixin` from line 5:10 of test.scss @@ -29,7 +29,7 @@ Error: Mixin @content is missing argument $arg1. <===> ================================================================================ -<===> none_expected/input.scss +<===> args/none_expected/input.scss // It's an error to pass argments to a content block that doesn't take them. @mixin mixin { @content(value); @@ -37,7 +37,7 @@ Error: Mixin @content is missing argument $arg1. @include mixin {} -<===> none_expected/error +<===> args/none_expected/error Error: Only 0 arguments allowed, but 1 was passed. , 3 | @content(value); @@ -50,7 +50,7 @@ Error: Only 0 arguments allowed, but 1 was passed. input.scss 3:3 mixin() input.scss 6:1 root stylesheet -<===> none_expected/error-libsass +<===> args/none_expected/error-libsass Error: wrong number of arguments (1 for 0) for `@content' on line 2:3 of test.scss, in mixin `@content` from line 2:3 of test.scss, in mixin `mixin` @@ -61,7 +61,7 @@ Error: wrong number of arguments (1 for 0) for `@content' <===> ================================================================================ -<===> named/input.scss +<===> args/named/input.scss // It's an error to pass a named argument that doesn't exist. @mixin mixin { @content($invalid: value); @@ -69,7 +69,7 @@ Error: wrong number of arguments (1 for 0) for `@content' @include mixin using ($valid: value) {} -<===> named/error +<===> args/named/error Error: No argument named $invalid. , 3 | @content($invalid: value); @@ -82,7 +82,7 @@ Error: No argument named $invalid. input.scss 3:3 mixin() input.scss 6:1 root stylesheet -<===> named/error-libsass +<===> args/named/error-libsass Error: Mixin @content has no parameter named $invalid on line 2:12 of test.scss, in mixin `@content` from line 2:3 of test.scss, in mixin `mixin` @@ -93,7 +93,7 @@ Error: Mixin @content has no parameter named $invalid <===> ================================================================================ -<===> too_few/input.scss +<===> args/too_few/input.scss // It's an error to pass fewer positional arguments than are required. @mixin mixin { @content(1); @@ -101,7 +101,7 @@ Error: Mixin @content has no parameter named $invalid @include mixin using ($arg1, $arg2) {} -<===> too_few/error +<===> args/too_few/error Error: Missing argument $arg2. , 3 | @content(1); @@ -114,7 +114,7 @@ Error: Missing argument $arg2. input.scss 3:3 mixin() input.scss 6:1 root stylesheet -<===> too_few/error-libsass +<===> args/too_few/error-libsass Error: Mixin @content is missing argument $arg2. on line 2:3 of test.scss, in mixin `mixin` from line 5:10 of test.scss @@ -124,7 +124,7 @@ Error: Mixin @content is missing argument $arg2. <===> ================================================================================ -<===> too_many/input.scss +<===> args/too_many/input.scss // It's an error to pass more positional arguments than are required. @mixin mixin { @content(1, 2, 3); @@ -132,7 +132,7 @@ Error: Mixin @content is missing argument $arg2. @include mixin using ($arg1, $arg2) {} -<===> too_many/error +<===> args/too_many/error Error: Only 2 arguments allowed, but 3 were passed. , 3 | @content(1, 2, 3); @@ -145,7 +145,7 @@ Error: Only 2 arguments allowed, but 3 were passed. input.scss 3:3 mixin() input.scss 6:1 root stylesheet -<===> too_many/error-libsass +<===> args/too_many/error-libsass Error: wrong number of arguments (3 for 2) for `@content' on line 2:3 of test.scss, in mixin `@content` from line 2:3 of test.scss, in mixin `mixin` @@ -153,3 +153,123 @@ Error: wrong number of arguments (3 for 2) for `@content' >> @content(1, 2, 3); --^ + +<===> +================================================================================ +<===> syntax/arglist/invalid/input.scss +@mixin mixin { + @content; +} + +@include mixin() using ($arg1: ) {} + +<===> syntax/arglist/invalid/error +Error: Expected expression. + , +5 | @include mixin() using ($arg1: ) {} + | ^ + ' + input.scss 5:32 root stylesheet + +<===> syntax/arglist/invalid/error-libsass +Error: Invalid CSS after "...) using ($arg1:": expected expression (e.g. 1px, bold), was ") {}" + on line 5:32 of test.scss +>> @include mixin() using ($arg1: ) {} + + -------------------------------^ + +<===> +================================================================================ +<===> syntax/arglist/missing/input.scss +@mixin mixin { + @content; +} + +@include mixin using {} + +<===> syntax/arglist/missing/error +Error: expected "(". + , +5 | @include mixin using {} + | ^ + ' + input.scss 5:22 root stylesheet + +<===> syntax/arglist/missing/error-libsass +Error: Invalid CSS after "...ude mixin using": expected "(", was "{}" + on line 5:16 of test.scss +>> @include mixin using {} + + ---------------^ + +<===> +================================================================================ +<===> syntax/arglist/missing_parens/input.scss +@mixin mixin { + @content; +} + +@include mixin using $arg1 {} + +<===> syntax/arglist/missing_parens/error +Error: expected "(". + , +5 | @include mixin using $arg1 {} + | ^ + ' + input.scss 5:22 root stylesheet + +<===> syntax/arglist/missing_parens/error-libsass +Error: Invalid CSS after "...ude mixin using": expected "(", was "$arg1 {}" + on line 5:16 of test.scss +>> @include mixin using $arg1 {} + + ---------------^ + +<===> +================================================================================ +<===> syntax/missing_using/input.scss +@mixin mixin { + @content; +} + +@include mixin() () {} + +<===> syntax/missing_using/error +Error: expected ";". + , +5 | @include mixin() () {} + | ^ + ' + input.scss 5:18 root stylesheet + +<===> syntax/missing_using/error-libsass +Error: Invalid CSS after "@include mixin()": expected ";", was "() {}" + on line 5:16 of test.scss +>> @include mixin() () {} + + ---------------^ + +<===> +================================================================================ +<===> syntax/missing_block/input.scss +@mixin mixin { + @content; +} + +@include mixin using (); + +<===> syntax/missing_block/error +Error: expected "{". + , +5 | @include mixin using (); + | ^ + ' + input.scss 5:24 root stylesheet + +<===> syntax/missing_block/error-libsass +Error: Invalid CSS after "... mixin using ()": expected "{", was ";" + on line 5:23 of test.scss +>> @include mixin using (); + + ----------------------^ diff --git a/spec/directives/mixin/content/arguments/none.hrx b/spec/directives/mixin/content/arguments/none.hrx new file mode 100644 index 0000000000..d2af8130d8 --- /dev/null +++ b/spec/directives/mixin/content/arguments/none.hrx @@ -0,0 +1,105 @@ +<===> no_parens/no_using/input.scss +@mixin mixin { + @content; +} + +a { + @include mixin { + x: y; + } +} + +<===> no_parens/no_using/output.css +a { + x: y; +} + +<===> +================================================================================ +<===> no_parens/empty_using/input.scss +@mixin mixin { + @content; +} + +a { + @include mixin using () { + x: y; + } +} + +<===> no_parens/empty_using/output.css +a { + x: y; +} + +<===> +================================================================================ +<===> no_parens/default_using/input.scss +@mixin mixin { + @content; +} + +a { + @include mixin using ($arg: value) { + arg: $arg; + } +} + +<===> no_parens/default_using/output.css +a { + arg: value; +} + +<===> +================================================================================ +<===> with_parens/no_using/input.scss +@mixin mixin { + @content(); +} + +a { + @include mixin { + x: y; + } +} + +<===> with_parens/no_using/output.css +a { + x: y; +} + +<===> +================================================================================ +<===> with_parens/empty_using/input.scss +@mixin mixin { + @content(); +} + +a { + @include mixin using () { + x: y; + } +} + +<===> with_parens/empty_using/output.css +a { + x: y; +} + +<===> +================================================================================ +<===> with_parens/default_using/input.scss +@mixin mixin { + @content(); +} + +a { + @include mixin using ($arg: value) { + arg: $arg; + } +} + +<===> with_parens/default_using/output.css +a { + arg: value; +} diff --git a/spec/directives/mixin/content/arguments/passing.hrx b/spec/directives/mixin/content/arguments/passing.hrx new file mode 100644 index 0000000000..a6e8062f00 --- /dev/null +++ b/spec/directives/mixin/content/arguments/passing.hrx @@ -0,0 +1,97 @@ +<===> by_position/input.scss +@mixin mixin { + @content(value1, value2); +} + +a { + @include mixin using ($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> by_position/output.css +a { + arg1: value1; + arg2: value2; +} + +<===> +================================================================================ +<===> by_name/input.scss +@mixin mixin { + @content($arg2: value2, $arg1: value1); +} + +a { + @include mixin using ($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> by_name/output.css +a { + arg1: value1; + arg2: value2; +} + +<===> +================================================================================ +<===> list_splat/input.scss +@mixin mixin { + @content((value1 value2)...); +} + +a { + @include mixin using ($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> list_splat/output.css +a { + arg1: value1; + arg2: value2; +} + +<===> +================================================================================ +<===> map_splat/input.scss +@mixin mixin { + @content((arg1: value1, arg2: value2)...); +} + +a { + @include mixin using ($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> map_splat/output.css +a { + arg1: value1; + arg2: value2; +} + +<===> +================================================================================ +<===> mixed_splat/input.scss +@mixin mixin { + @content((value1,)..., (arg2: value2)...); +} + +a { + @include mixin using ($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> mixed_splat/output.css +a { + arg1: value1; + arg2: value2; +} diff --git a/spec/directives/mixin/content/arguments/receiving.hrx b/spec/directives/mixin/content/arguments/receiving.hrx new file mode 100644 index 0000000000..fc03dc3929 --- /dev/null +++ b/spec/directives/mixin/content/arguments/receiving.hrx @@ -0,0 +1,148 @@ +<===> with_defaults/nothing_passed/input.scss +@mixin mixin { + @content; +} + +a { + @include mixin using ($arg1: value1, $arg2: value2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> with_defaults/nothing_passed/output.css +a { + arg1: value1; + arg2: value2; +} + +<===> +================================================================================ +<===> with_defaults/partial_override/input.scss +@mixin mixin { + @content($arg2: other2); +} + +a { + @include mixin using ($arg1: value1, $arg2: value2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> with_defaults/partial_override/output.css +a { + arg1: value1; + arg2: other2; +} + +<===> +================================================================================ +<===> with_defaults/total_override/input.scss +@mixin mixin { + @content(other1, other2); +} + +a { + @include mixin using ($arg1: value1, $arg2: value2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> with_defaults/total_override/output.css +a { + arg1: other1; + arg2: other2; +} + +<===> +================================================================================ +<===> with_splat/nothing_passed/input.scss +@mixin mixin { + @content; +} + +a { + @include mixin using ($args...) { + positional: inspect($args); + keywords: inspect(keywords($args)); + } +} + +<===> with_splat/nothing_passed/output.css +a { + positional: (); + keywords: (); +} + +<===> +================================================================================ +<===> with_splat/positional_passed/input.scss +@mixin mixin { + @content(value1, value2, value3); +} + +a { + @include mixin using ($args...) { + positional: inspect($args); + keywords: inspect(keywords($args)); + } +} + +<===> with_splat/positional_passed/output.css +a { + positional: value1, value2, value3; + keywords: (); +} + +<===> +================================================================================ +<===> with_splat/named_passed/input.scss +@mixin mixin { + @content($arg1: value1, $arg2: value2); +} + +a { + @include mixin using ($args...) { + positional: inspect($args); + keywords: inspect(keywords($args)); + } +} + +<===> with_splat/named_passed/output.css +a { + positional: (); + keywords: (arg1: value1, arg2: value2); +} + +<===> with_splat/named_passed/output-libsass.css +a { + keywords: (arg1: value1, arg2: value2); +} + +<===> +================================================================================ +<===> with_splat/both_passed/input.scss +@mixin mixin { + @content(value1, $arg2: value2); +} + +a { + @include mixin using ($args...) { + positional: inspect($args); + keywords: inspect(keywords($args)); + } +} + +<===> with_splat/both_passed/output.css +a { + positional: (value1,); + keywords: (arg2: value2); +} + +<===> with_splat/both_passed/output-libsass.css +a { + positional: value1; + keywords: (arg2: value2); +} diff --git a/spec/directives/mixin/content/arguments/scope.hrx b/spec/directives/mixin/content/arguments/scope.hrx new file mode 100644 index 0000000000..be10e19bbc --- /dev/null +++ b/spec/directives/mixin/content/arguments/scope.hrx @@ -0,0 +1,74 @@ +<===> README.md +Arguments passed to @content blocks are lexically scoped within those blocks. + +<===> +================================================================================ +<===> no_argument/input.scss +$var: top-level; + +@mixin mixin($var) { + mixin-var-before: $var; + @content; + mixin-var-after: $var; +} + +a { + @include mixin(mixin-argument) { + content-var: $var; + } +} + +<===> no_argument/output.css +a { + mixin-var-before: mixin-argument; + content-var: top-level; + mixin-var-after: mixin-argument; +} + +<===> +================================================================================ +<===> with_argument/input.scss +$var: top-level; + +@mixin mixin($var) { + mixin-var-before: $var; + @content(content-argument); + mixin-var-after: $var; +} + +a { + @include mixin(mixin-argument) using ($var) { + content-var: $var; + } +} + +<===> with_argument/output.css +a { + mixin-var-before: mixin-argument; + content-var: content-argument; + mixin-var-after: mixin-argument; +} + +<===> +================================================================================ +<===> with_inner_mixin/input.scss +$var: top-level; + +@mixin mixin($var) { + @content(content-argument); +} + +@mixin inner { + var: $var +} + +a { + @include mixin(mixin-argument) using ($var) { + @include inner; + } +} + +<===> with_inner_mixin/output.css +a { + var: top-level; +} diff --git a/spec/directives/mixin/content/arguments/syntax.hrx b/spec/directives/mixin/content/arguments/syntax.hrx new file mode 100644 index 0000000000..e7b365d57a --- /dev/null +++ b/spec/directives/mixin/content/arguments/syntax.hrx @@ -0,0 +1,98 @@ +<===> no_space/before_using/input.scss +@mixin mixin { + @content(value1, value2); +} + +a { + @include mixin()using ($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> no_space/before_using/output.css +a { + arg1: value1; + arg2: value2; +} + +<===> +================================================================================ +<===> no_space/after_using/input.scss +@mixin mixin { + @content(value1, value2); +} + +a { + @include mixin using($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> no_space/after_using/output.css +a { + arg1: value1; + arg2: value2; +} + +<===> +================================================================================ +<===> no_space/after_arglist/input.scss +@mixin mixin { + @content(value1, value2); +} + +a { + @include mixin using ($arg1, $arg2){ + arg1: $arg1; + arg2: $arg2; + } +} + +<===> no_space/after_arglist/output.css +a { + arg1: value1; + arg2: value2; +} + +<===> +================================================================================ +<===> space_after_content/input.scss +@mixin mixin { + @content (value1, value2); +} + +a { + @include mixin using ($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> space_after_content/output.css +a { + arg1: value1; + arg2: value2; +} + +<===> +================================================================================ +<===> case_insensitive_using/input.scss +@mixin mixin { + @content(value1, value2); +} + +a { + @include mixin UsInG ($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } +} + +<===> case_insensitive_using/output.css +a { + arg1: value1; + arg2: value2; +} + diff --git a/spec/non_conformant/mixin/error/no_content.hrx b/spec/directives/mixin/content/error.hrx similarity index 71% rename from spec/non_conformant/mixin/error/no_content.hrx rename to spec/directives/mixin/content/error.hrx index 4d2be5304f..5bb8cc649d 100644 --- a/spec/non_conformant/mixin/error/no_content.hrx +++ b/spec/directives/mixin/content/error.hrx @@ -1,9 +1,9 @@ -<===> input.scss +<===> no_content/input.scss // A content block may not be passed to a mixin that doesn't include `@content`. @mixin no-content {} @include no-content {} -<===> error +<===> no_content/error Error: Mixin doesn't accept a content block. , 2 | @mixin no-content {} @@ -13,9 +13,9 @@ Error: Mixin doesn't accept a content block. ' input.scss 3:1 root stylesheet -<===> error-libsass +<===> no_content/error-libsass Error: Mixin "no-content" does not accept a content block. - on line 3:10 of /sass/spec/mixin/error/no_content/input.scss + on line 3:10 of /sass/spec/directives/mixin/content/error/no_content/input.scss >> @include no-content {} ---------^ diff --git a/spec/non_conformant/mixin/content/arguments/error/syntax.hrx b/spec/non_conformant/mixin/content/arguments/error/syntax.hrx deleted file mode 100644 index 92913f79bb..0000000000 --- a/spec/non_conformant/mixin/content/arguments/error/syntax.hrx +++ /dev/null @@ -1,117 +0,0 @@ -<===> arglist/invalid/input.scss -@mixin mixin { - @content; -} - -@include mixin() using ($arg1: ) {} - -<===> arglist/invalid/error -Error: Expected expression. - , -5 | @include mixin() using ($arg1: ) {} - | ^ - ' - input.scss 5:32 root stylesheet - -<===> arglist/invalid/error-libsass -Error: Invalid CSS after "...) using ($arg1:": expected expression (e.g. 1px, bold), was ") {}" - on line 5:32 of test.scss ->> @include mixin() using ($arg1: ) {} - - -------------------------------^ - -<===> -================================================================================ -<===> arglist/missing/input.scss -@mixin mixin { - @content; -} - -@include mixin using {} - -<===> arglist/missing/error -Error: expected "(". - , -5 | @include mixin using {} - | ^ - ' - input.scss 5:22 root stylesheet - -<===> arglist/missing/error-libsass -Error: Invalid CSS after "...ude mixin using": expected "(", was "{}" - on line 5:16 of test.scss ->> @include mixin using {} - - ---------------^ - -<===> -================================================================================ -<===> arglist/missing_parens/input.scss -@mixin mixin { - @content; -} - -@include mixin using $arg1 {} - -<===> arglist/missing_parens/error -Error: expected "(". - , -5 | @include mixin using $arg1 {} - | ^ - ' - input.scss 5:22 root stylesheet - -<===> arglist/missing_parens/error-libsass -Error: Invalid CSS after "...ude mixin using": expected "(", was "$arg1 {}" - on line 5:16 of test.scss ->> @include mixin using $arg1 {} - - ---------------^ - -<===> -================================================================================ -<===> missing_using/input.scss -@mixin mixin { - @content; -} - -@include mixin() () {} - -<===> missing_using/error -Error: expected ";". - , -5 | @include mixin() () {} - | ^ - ' - input.scss 5:18 root stylesheet - -<===> missing_using/error-libsass -Error: Invalid CSS after "@include mixin()": expected ";", was "() {}" - on line 5:16 of test.scss ->> @include mixin() () {} - - ---------------^ - -<===> -================================================================================ -<===> missing_block/input.scss -@mixin mixin { - @content; -} - -@include mixin using (); - -<===> missing_block/error -Error: expected "{". - , -5 | @include mixin using (); - | ^ - ' - input.scss 5:24 root stylesheet - -<===> missing_block/error-libsass -Error: Invalid CSS after "... mixin using ()": expected "{", was ";" - on line 5:23 of test.scss ->> @include mixin using (); - - ----------------------^ diff --git a/spec/non_conformant/mixin/content/arguments/none.hrx b/spec/non_conformant/mixin/content/arguments/none.hrx deleted file mode 100644 index 400573ff41..0000000000 --- a/spec/non_conformant/mixin/content/arguments/none.hrx +++ /dev/null @@ -1,67 +0,0 @@ -<===> input.scss -// `@content()` and `@content` should behave identically, as should -// `@include foo` and `@include foo using ()`. - -no-parens { - @mixin mixin { - @content; - } - - empty-using { - @include mixin using () { - x: y; - } - } - - defaults { - @include mixin using ($arg1: value1, $arg2: value2) { - arg1: $arg1; - arg2: $arg2; - } - } -} - -parens { - @mixin mixin { - @content(); - } - - no-using { - @include mixin { - x: y; - } - } - - empty-using { - @include mixin using () { - x: y; - } - } - - defaults { - @include mixin using ($arg1: value1, $arg2: value2) { - arg1: $arg1; - arg2: $arg2; - } - } -} - -<===> output.css -no-parens empty-using { - x: y; -} -no-parens defaults { - arg1: value1; - arg2: value2; -} - -parens no-using { - x: y; -} -parens empty-using { - x: y; -} -parens defaults { - arg1: value1; - arg2: value2; -} diff --git a/spec/non_conformant/mixin/content/arguments/passing.hrx b/spec/non_conformant/mixin/content/arguments/passing.hrx deleted file mode 100644 index 359cae844b..0000000000 --- a/spec/non_conformant/mixin/content/arguments/passing.hrx +++ /dev/null @@ -1,84 +0,0 @@ -<===> input.scss -// Arguments can be passed to content blocks in all the same ways as they're -// passed to any other argument list. - -by-position { - @mixin mixin { - @content(value1, value2); - } - - @include mixin using ($arg1, $arg2) { - arg1: $arg1; - arg2: $arg2; - } -} - -by-name { - @mixin mixin { - @content($arg1: value1, $arg2: value2); - } - - @include mixin using ($arg1, $arg2) { - arg1: $arg1; - arg2: $arg2; - } -} - -list-splat { - @mixin mixin { - @content((value1 value2)...); - } - - @include mixin using ($arg1, $arg2) { - arg1: $arg1; - arg2: $arg2; - } -} - -map-splat { - @mixin mixin { - @content((arg1: value1, arg2: value2)...); - } - - @include mixin using ($arg1, $arg2) { - arg1: $arg1; - arg2: $arg2; - } -} - -mixed-splat { - @mixin mixin { - @content((value1,)..., (arg2: value2)...); - } - - @include mixin using ($arg1, $arg2) { - arg1: $arg1; - arg2: $arg2; - } -} - -<===> output.css -by-position { - arg1: value1; - arg2: value2; -} - -by-name { - arg1: value1; - arg2: value2; -} - -list-splat { - arg1: value1; - arg2: value2; -} - -map-splat { - arg1: value1; - arg2: value2; -} - -mixed-splat { - arg1: value1; - arg2: value2; -} diff --git a/spec/non_conformant/mixin/content/arguments/receiving.hrx b/spec/non_conformant/mixin/content/arguments/receiving.hrx deleted file mode 100644 index 47700a5f9d..0000000000 --- a/spec/non_conformant/mixin/content/arguments/receiving.hrx +++ /dev/null @@ -1,145 +0,0 @@ -<===> input.scss -// Content blocks' argument lists can define arguments in in all the same ways -// as they're defined in any other argument list. - -with-defaults { - nothing-passed { - @mixin mixin { - @content; - } - - @include mixin using ($arg1: value1, $arg2: value2) { - arg1: $arg1; - arg2: $arg2; - } - } - - partial-override { - @mixin mixin { - @content($arg2: other2); - } - - @include mixin using ($arg1: value1, $arg2: value2) { - arg1: $arg1; - arg2: $arg2; - } - } - - total-override { - @mixin mixin { - @content(other1, other2); - } - - @include mixin using ($arg1: value1, $arg2: value2) { - arg1: $arg1; - arg2: $arg2; - } - } -} - -with-splat { - nothing-passed { - @mixin mixin { - @content; - } - - @include mixin using ($args...) { - positional: inspect($args); - keywords: inspect(keywords($args)); - } - } - - positional-passed { - @mixin mixin { - @content(value1, value2, value3); - } - - @include mixin using ($args...) { - positional: inspect($args); - keywords: inspect(keywords($args)); - } - } - - named-passed { - @mixin mixin { - @content($arg1: value1, $arg2: value2); - } - - @include mixin using ($args...) { - positional: inspect($args); - keywords: inspect(keywords($args)); - } - } - - both-passed { - @mixin mixin { - @content(value1, $arg2: value2); - } - - @include mixin using ($args...) { - positional: inspect($args); - keywords: inspect(keywords($args)); - } - } -} - -<===> output.css -with-defaults nothing-passed { - arg1: value1; - arg2: value2; -} -with-defaults partial-override { - arg1: value1; - arg2: other2; -} -with-defaults total-override { - arg1: other1; - arg2: other2; -} - -with-splat nothing-passed { - positional: (); - keywords: (); -} -with-splat positional-passed { - positional: value1, value2, value3; - keywords: (); -} -with-splat named-passed { - positional: (); - keywords: (arg1: value1, arg2: value2); -} -with-splat both-passed { - positional: (value1,); - keywords: (arg2: value2); -} - -<===> output-libsass.css -with-defaults nothing-passed { - arg1: value1; - arg2: value2; -} -with-defaults partial-override { - arg1: value1; - arg2: other2; -} -with-defaults total-override { - arg1: other1; - arg2: other2; -} - -with-splat nothing-passed { - positional: (); - keywords: (); -} -with-splat positional-passed { - positional: value1, value2, value3; - keywords: (); -} -with-splat named-passed { - keywords: (arg1: value1, arg2: value2); -} -with-splat both-passed { - positional: value1; - keywords: (arg2: value2); -} diff --git a/spec/non_conformant/mixin/content/arguments/scope.hrx b/spec/non_conformant/mixin/content/arguments/scope.hrx deleted file mode 100644 index beb2774007..0000000000 --- a/spec/non_conformant/mixin/content/arguments/scope.hrx +++ /dev/null @@ -1,35 +0,0 @@ -<===> input.scss -// Arguments passed to @content blocks are lexically-scoped within those blocks. - -$var: top-level; - -@mixin mixin($var) { - mixin-var-before: $var; - @content(content-argument); - mixin-var-after: $var; -} - -@mixin inner { - var-in-inner: $var; -} - -scope { - var-before: $var; - @include mixin(mixin-argument) using ($var) { - content-var-before: $var; - @include inner; - content-var-after: $var; - } - var-after: $var; -} - -<===> output.css -scope { - var-before: top-level; - mixin-var-before: mixin-argument; - content-var-before: content-argument; - var-in-inner: top-level; - content-var-after: content-argument; - mixin-var-after: mixin-argument; - var-after: top-level; -} diff --git a/spec/non_conformant/mixin/content/arguments/weird_syntax.hrx b/spec/non_conformant/mixin/content/arguments/weird_syntax.hrx deleted file mode 100644 index ec5a142b00..0000000000 --- a/spec/non_conformant/mixin/content/arguments/weird_syntax.hrx +++ /dev/null @@ -1,81 +0,0 @@ -<===> input.scss -no-space-before-using { - @mixin mixin { - @content(value1, value2); - } - - @include mixin()using ($arg1, $arg2) { - arg1: $arg1; - arg2: $arg2; - } -} - -no-space-after-using { - @mixin mixin { - @content(value1, value2); - } - - @include mixin using($arg1, $arg2) { - arg1: $arg1; - arg2: $arg2; - } -} - -no-space-after-arglist { - @mixin mixin { - @content(value1, value2); - } - - @include mixin using($arg1, $arg2){ - arg1: $arg1; - arg2: $arg2; - } -} - -space-after-content { - @mixin mixin { - @content (value1, value2); - } - - @include mixin using ($arg1, $arg2) { - arg1: $arg1; - arg2: $arg2; - } -} - -case-insensitive-using { - @mixin mixin { - @content(value1, value2); - } - - @include mixin UsInG ($arg1, $arg2) { - arg1: $arg1; - arg2: $arg2; - } -} - -<===> output.css -no-space-before-using { - arg1: value1; - arg2: value2; -} - -no-space-after-using { - arg1: value1; - arg2: value2; -} - -no-space-after-arglist { - arg1: value1; - arg2: value2; -} - -space-after-content { - arg1: value1; - arg2: value2; -} - -case-insensitive-using { - arg1: value1; - arg2: value2; -}