diff --git a/spec/core_functions/meta/load_css/error.hrx b/spec/core_functions/meta/load_css/error.hrx index a71ef14029..3f1528620c 100644 --- a/spec/core_functions/meta/load_css/error.hrx +++ b/spec/core_functions/meta/load_css/error.hrx @@ -149,7 +149,7 @@ Error: $a was not declared with !default in the @used module. <===> with/namespace/_midstream.scss @use "upstream"; -$upstream.a: c !default; +upstream.$a: c !default; <===> with/namespace/_upstream.scss $a: d; @@ -582,7 +582,7 @@ Error: Undefined variable. @use "sass:meta"; @meta.load-css("other"); -a {b: $other.c} +a {b: other.$c} <===> member/namespace/_other.scss $c: d; @@ -590,7 +590,7 @@ $c: d; <===> member/namespace/error Error: There is no module with the namespace "other". , -4 | a {b: $other.c} +4 | a {b: other.$c} | ^^^^^^^^ ' input.scss 4:7 root stylesheet diff --git a/spec/core_functions/meta/load_css/twice.hrx b/spec/core_functions/meta/load_css/twice.hrx index ca2bcbb24c..e4dc7fbb55 100644 --- a/spec/core_functions/meta/load_css/twice.hrx +++ b/spec/core_functions/meta/load_css/twice.hrx @@ -3,12 +3,12 @@ @use "shared"; @include meta.load-css("other"); -a {shared-b: $shared.b} +a {shared-b: shared.$b} <===> shares_state/_other.scss @use "shared"; -$shared.b: value set by other; +shared.$b: value set by other; <===> shares_state/_shared.scss $b: default value; diff --git a/spec/core_functions/meta/load_css/with.hrx b/spec/core_functions/meta/load_css/with.hrx index f58656dee9..8557c4ed4f 100644 --- a/spec/core_functions/meta/load_css/with.hrx +++ b/spec/core_functions/meta/load_css/with.hrx @@ -279,7 +279,7 @@ configuration will use the configured module. <===> multi_load/use/_midstream.scss @use "upstream"; -b {c: $upstream.a} +b {c: upstream.$a} <===> multi_load/use/_upstream.scss $a: original !default; @@ -297,7 +297,7 @@ b { @use "loads"; @use "midstream"; -b {c: $midstream.a} +b {c: midstream.$a} <===> multi_load/forward/_loads.scss @use "sass:meta"; diff --git a/spec/core_functions/modules/general.hrx b/spec/core_functions/modules/general.hrx index 20bb985315..d113540b36 100644 --- a/spec/core_functions/modules/general.hrx +++ b/spec/core_functions/modules/general.hrx @@ -22,12 +22,12 @@ a { ================================================================================ <===> error/set_variable/input.scss @use "sass:math"; -$math.a: b; +math.$a: b; <===> error/set_variable/error Error: Undefined variable. , -2 | $math.a: b; +2 | math.$a: b; | ^^^^^^^^^^ ' input.scss 2:1 root stylesheet diff --git a/spec/css/custom_properties/error.hrx b/spec/css/custom_properties/error.hrx index 61a7a5cc54..d8c49373b5 100644 --- a/spec/css/custom_properties/error.hrx +++ b/spec/css/custom_properties/error.hrx @@ -80,12 +80,12 @@ Error: Invalid CSS after " --prop: };": expected selector or at-rule, was "}" Use --trace for backtrace. <===> brackets/curly/error-dart-sass -Error: expected "{". +Error: unmatched "}". , -2 | --prop: }; - | ^ +3 | } + | ^ ' - input.scss 2:13 root stylesheet + input.scss 3:1 root stylesheet <===> ================================================================================ diff --git a/spec/directives/forward/member/as.hrx b/spec/directives/forward/member/as.hrx index f0277e1cf3..f612df2764 100644 --- a/spec/directives/forward/member/as.hrx +++ b/spec/directives/forward/member/as.hrx @@ -1,7 +1,7 @@ <===> variable_use/input.scss @use "midstream"; -a {b: $midstream.d-c} +a {b: midstream.$d-c} <===> variable_use/_midstream.scss @forward "upstream" as d-*; @@ -19,7 +19,7 @@ a { <===> variable_assignment/top_level/input.scss @use "midstream"; -$midstream.d-a: new value; +midstream.$d-a: new value; b {c: midstream.d-get-a()}; @@ -44,7 +44,7 @@ b { a { // Namespaced assignments always assign to the other module's variable, even // if they're nested in a block scope. - $midstream.d-b: new value; + midstream.$d-b: new value; c: midstream.d-get-b(); } @@ -103,7 +103,7 @@ c { <===> different_separator/input.scss @use "midstream"; -a {b: $midstream.d-c} +a {b: midstream.$d-c} <===> different_separator/_midstream.scss @forward "upstream" as d_*; diff --git a/spec/directives/forward/member/bare.hrx b/spec/directives/forward/member/bare.hrx index 620a526e06..fc7d14b21a 100644 --- a/spec/directives/forward/member/bare.hrx +++ b/spec/directives/forward/member/bare.hrx @@ -1,7 +1,7 @@ <===> variable_use/input.scss @use "midstream"; -a {b: $midstream.c} +a {b: midstream.$c} <===> variable_use/_midstream.scss @forward "upstream"; @@ -19,7 +19,7 @@ a { <===> variable_assignment/top_level/input.scss @use "midstream"; -$midstream.a: new value; +midstream.$a: new value; b {c: midstream.get-a()}; @@ -44,7 +44,7 @@ b { a { // Namespaced assignments always assign to the other module's variable, even // if they're nested in a block scope. - $midstream.b: new value; + midstream.$b: new value; c: midstream.get-b(); } diff --git a/spec/directives/forward/member/import.hrx b/spec/directives/forward/member/import.hrx index 9fe8bec814..aba4631b49 100644 --- a/spec/directives/forward/member/import.hrx +++ b/spec/directives/forward/member/import.hrx @@ -70,7 +70,7 @@ b { <===> forward_to_import/variable_assignment/input.scss @use "used"; -$used.a: new value; +used.$a: new value; b {c: used.get-a()}; @@ -95,7 +95,7 @@ b { <===> forward_to_import/variable_use/input.scss @use "used"; -a {b: $used.c} +a {b: used.$c} <===> forward_to_import/variable_use/_used.scss @forward "forwarded"; diff --git a/spec/directives/forward/member/shadowed.hrx b/spec/directives/forward/member/shadowed.hrx index 4215a2ccbb..aa53e12c86 100644 --- a/spec/directives/forward/member/shadowed.hrx +++ b/spec/directives/forward/member/shadowed.hrx @@ -1,7 +1,7 @@ <===> variable_use/input.scss @use "midstream"; -a {b: $midstream.c} +a {b: midstream.$c} <===> variable_use/_midstream.scss @forward "upstream"; @@ -21,7 +21,7 @@ a { <===> variable_assignment/top_level/input.scss @use "midstream"; -$midstream.a: new value; +midstream.$a: new value; b { midstream: midstream.get-midstream-a(); diff --git a/spec/directives/forward/member/visibility.hrx b/spec/directives/forward/member/visibility.hrx index ebb3213049..d16635eb8a 100644 --- a/spec/directives/forward/member/visibility.hrx +++ b/spec/directives/forward/member/visibility.hrx @@ -29,7 +29,7 @@ $a: old value; <===> hide/variable_assignment/input.scss @use "midstream"; -$midstream.a: new value; +midstream.$a: new value; b {c: midstream.get-a()}; @@ -47,7 +47,7 @@ $c: e; <===> hide/variable_use/input.scss @use "midstream"; -a {b: $midstream.c} +a {b: midstream.$c} <===> hide/variable_use/output.css a { @@ -83,7 +83,7 @@ $c: e; <===> hide/wrong_type/variable_use/input.scss @use "midstream"; -a {b: $midstream.c} +a {b: midstream.$c} <===> hide/wrong_type/variable_use/output.css a { @@ -123,7 +123,7 @@ $a: old value; <===> show/variable_assignment/input.scss @use "midstream"; -$midstream.a: new value; +midstream.$a: new value; b {c: midstream.get-a()}; @@ -141,7 +141,7 @@ $c: d; <===> show/variable_use/input.scss @use "midstream"; -a {b: $midstream.c} +a {b: midstream.$c} <===> show/variable_use/output.css a { diff --git a/spec/directives/use/error/member.hrx b/spec/directives/use/error/member.hrx index 76a337d41f..eee688d4ec 100644 --- a/spec/directives/use/error/member.hrx +++ b/spec/directives/use/error/member.hrx @@ -1,13 +1,13 @@ <===> missing_member/namespaced/variable_use/input.scss @use "other"; -a {b: $other.member} +a {b: other.$member} <===> missing_member/namespaced/variable_use/other.scss <===> missing_member/namespaced/variable_use/error Error: Undefined variable. , -3 | a {b: $other.member} +3 | a {b: other.$member} | ^^^^^^^^^^^^^ ' input.scss 3:7 root stylesheet @@ -17,13 +17,13 @@ Error: Undefined variable. <===> missing_member/namespaced/variable_declaration/input.scss @use "other"; -$other.member: value; +other.$member: value; <===> missing_member/namespaced/variable_declaration/other.scss <===> missing_member/namespaced/variable_declaration/error Error: Undefined variable. , -3 | $other.member: value; +3 | other.$member: value; | ^^^^^^^^^^^^^^^^^^^^ ' input.scss 3:1 root stylesheet @@ -95,7 +95,7 @@ Error: Undefined mixin. <===> ================================================================================ <===> member_before_use/variable_use/input.scss -$variable: $other.member; +$variable: other.$member; @use "other"; <===> member_before_use/variable_use/other.scss @@ -104,7 +104,7 @@ $member: value; <===> member_before_use/variable_use/error Error: There is no module with the namespace "other". , -1 | $variable: $other.member; +1 | $variable: other.$member; | ^^^^^^^^^^^^^ ' input.scss 1:12 root stylesheet @@ -112,7 +112,7 @@ Error: There is no module with the namespace "other". <===> ================================================================================ <===> member_before_use/variable_declaration/input.scss -$other.member: value; +other.$member: value; @use "other"; <===> member_before_use/variable_declaration/other.scss @@ -121,7 +121,7 @@ $member: value; <===> member_before_use/variable_declaration/error Error: There is no module with the namespace "other". , -1 | $other.member: value; +1 | other.$member: value; | ^^^^^^^^^^^^^^^^^^^^ ' input.scss 1:1 root stylesheet diff --git a/spec/directives/use/error/syntax.hrx b/spec/directives/use/error/syntax.hrx index 2060f9ce44..7ed8f07b3e 100644 --- a/spec/directives/use/error/syntax.hrx +++ b/spec/directives/use/error/syntax.hrx @@ -314,12 +314,12 @@ Error: Expected identifier. <===> ================================================================================ <===> member/variable/no_member/input.scss -a {a: $namespace.} +a {a: namespace.$} <===> member/variable/no_member/error Error: Expected identifier. , -1 | a {a: $namespace.} +1 | a {a: namespace.$} | ^ ' input.scss 1:18 root stylesheet @@ -327,25 +327,25 @@ Error: Expected identifier. <===> ================================================================================ <===> member/variable/private/input.scss -a {a: $namespace._member} +a {a: namespace.$_member} <===> member/variable/private/error Error: Private members can't be accessed from outside their modules. , -1 | a {a: $namespace._member} - | ^^^^^^^ +1 | a {a: namespace.$_member} + | ^^^^^^^^^^^^^^^^^^ ' - input.scss 1:18 root stylesheet + input.scss 1:7 root stylesheet <===> ================================================================================ <===> member/variable/global/input.scss -$namespace.member: value !global; +namespace.$member: value !global; <===> member/variable/global/error Error: !global isn't allowed for variables in other modules. , -1 | $namespace.member: value !global; +1 | namespace.$member: value !global; | ^^^^^^^ ' input.scss 1:26 root stylesheet @@ -408,16 +408,16 @@ Error: expected "{". // Private member usage is a syntax error, so it should fail at parse time // without needing to be executed. @function foo() { - @debug $namespace._member; + @debug namespace.$_member; } <===> member/unused_private/error Error: Private members can't be accessed from outside their modules. , -4 | @debug $namespace._member; - | ^^^^^^^ +4 | @debug namespace.$_member; + | ^^^^^^^^^^^^^^^^^^ ' - input.scss 4:21 root stylesheet + input.scss 4:10 root stylesheet <===> ================================================================================ @@ -474,15 +474,15 @@ Error: Expected identifier. <===> ================================================================================ <===> with/namespace_variable/input.scss -@use "other" with ($a.b: c); +@use "other" with (a.$b: c); <===> with/namespace_variable/error -Error: expected ":". +Error: expected "$". , -1 | @use "other" with ($a.b: c); - | ^ +1 | @use "other" with (a.$b: c); + | ^ ' - input.scss 1:22 root stylesheet + input.scss 1:20 root stylesheet <===> ================================================================================ diff --git a/spec/directives/use/error/with.hrx b/spec/directives/use/error/with.hrx index fcfb0b301b..51a9064733 100644 --- a/spec/directives/use/error/with.hrx +++ b/spec/directives/use/error/with.hrx @@ -37,7 +37,7 @@ Error: This variable was not declared with !default in the @used module. <===> namespace/_midstream.scss @use "upstream"; -$upstream.a: c !default; +upstream.$a: c !default; <===> namespace/_upstream.scss $a: d; @@ -132,7 +132,7 @@ Error: Undefined variable. <===> ================================================================================ <===> invalid_expression/module_loaded_later/input.scss -@use "configured" with ($a: $other.b); +@use "configured" with ($a: other.$b); @use "other"; <===> invalid_expression/module_loaded_later/_configured.scss @@ -144,7 +144,7 @@ $b: d; <===> invalid_expression/module_loaded_later/error Error: There is no module with the namespace "other". , -1 | @use "configured" with ($a: $other.b); +1 | @use "configured" with ($a: other.$b); | ^^^^^^^^ ' input.scss 1:29 root stylesheet diff --git a/spec/directives/use/member.hrx b/spec/directives/use/member.hrx index a3a10a905e..888d7d8d8a 100644 --- a/spec/directives/use/member.hrx +++ b/spec/directives/use/member.hrx @@ -1,7 +1,7 @@ <===> namespaced/default/variable_use/input.scss @use "other"; -a {b: $other.member} +a {b: other.$member} <===> namespaced/default/variable_use/other.scss $member: value; @@ -16,7 +16,7 @@ a { <===> namespaced/default/variable_assignment/top_level/input.scss @use "other"; -$other.member: new value; +other.$member: new value; a {b: other.get-member()}; @@ -38,7 +38,7 @@ a { a { // Namespaced assignments always assign to the other module's variable, even // if they're nested in a block scope. - $other.member: new value; + other.$member: new value; b: other.get-member(); } @@ -53,6 +53,58 @@ a { b: new value; } +<===> +================================================================================ +<===> namespaced/default/variable_assignment/in_function/input.scss +@use "other"; + +@function a() { + // Test assignments within a function specially, because functions disallow + // property declarations and variable assignments need to be disambiguated + // with those. + other.$member: new value; + + @return other.get-member(); +} + +b {c: a()} + +<===> namespaced/default/variable_assignment/in_function/other.scss +$member: value; + +@function get-member() {@return $member} + +<===> namespaced/default/variable_assignment/in_function/output.css +b { + c: new value; +} + +<===> +================================================================================ +<===> namespaced/default/variable_assignment/in_declaration/input.scss +@use "other"; + +a { + b: { + // Test assignments within a declaration specially, because declarations + // disallow style rules and variable assignments need to be disambiguated + // with those. + other.$member: new value; + + c: other.get-member(); + } +} + +<===> namespaced/default/variable_assignment/in_declaration/other.scss +$member: value; + +@function get-member() {@return $member} + +<===> namespaced/default/variable_assignment/in_declaration/output.css +a { + b-c: new value; +} + <===> ================================================================================ <===> namespaced/default/function/input.scss @@ -88,7 +140,7 @@ a { <===> namespaced/explicit/variable_use/input.scss @use "other" as o; -a {b: $o.member} +a {b: o.$member} <===> namespaced/explicit/variable_use/other.scss $member: value; @@ -103,7 +155,7 @@ a { <===> namespaced/explicit/variable_assignment/input.scss @use "other" as o; -$o.member: new value; +o.$member: new value; a {b: o.get-member()} @@ -263,7 +315,7 @@ a { <===> use_to_import/variable_use/input.scss @use "midstream"; -a {b: $midstream.member} +a {b: midstream.$member} <===> use_to_import/variable_use/midstream.scss @import "upstream"; @@ -281,7 +333,7 @@ a { <===> use_to_import/variable_assignment/input.scss @use "midstream"; -$midstream.member: new value; +midstream.$member: new value; a {b: midstream.get-member()} @@ -341,7 +393,7 @@ a { // are discarded. @use "foo/bar/../baz/qux/other"; -a {b: $other.variable} +a {b: other.$variable} <===> default_namespace/basename/foo/baz/qux/other.scss $variable: value; @@ -357,7 +409,7 @@ a { // All extensions on the URL are discarded before determining the namespace. @use "other.foo.bar.baz.scss"; -a {b: $other.variable} +a {b: other.$variable} <===> default_namespace/without_extensions/other.foo.bar.baz.scss $variable: value; @@ -372,7 +424,7 @@ a { <===> nested_global_variable/direct/input.scss @use "other"; -a {b: inspect($other.member)} +a {b: inspect(other.$member)} <===> nested_global_variable/direct/other.scss x { @@ -395,7 +447,7 @@ a { <===> nested_global_variable/through_import/input.scss @use "used"; -a {b: inspect($used.member)} +a {b: inspect(used.$member)} <===> nested_global_variable/through_import/used.scss @import "imported"; diff --git a/spec/directives/use/with.hrx b/spec/directives/use/with.hrx index 90100e4c57..527710ce75 100644 --- a/spec/directives/use/with.hrx +++ b/spec/directives/use/with.hrx @@ -126,7 +126,7 @@ b { ================================================================================ <===> used_in_input/input.scss @use "other" with ($a: configured); -b {c: $other.a} +b {c: other.$a} <===> used_in_input/_other.scss $a: original !default; @@ -294,7 +294,7 @@ configuration will use the configured module. <===> multi_load/use/_midstream.scss @use "upstream"; -b {c: $upstream.a} +b {c: upstream.$a} <===> multi_load/use/_upstream.scss $a: original !default; @@ -309,7 +309,7 @@ b { <===> multi_load/forward/input.scss @use "upstream" with ($a: configured); @use "midstream"; -b {c: $midstream.a} +b {c: midstream.$a} <===> multi_load/forward/_midstream.scss @forward "upstream";