-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2918dab
commit ad782cd
Showing
11 changed files
with
1,038 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<===> accepts/direct-child/input.scss | ||
@use "sass:meta"; | ||
|
||
@mixin foo() { | ||
@content; | ||
} | ||
|
||
a {b: meta.accepts-content(meta.get-mixin("foo"))} | ||
|
||
<===> accepts/direct-child/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> accepts/nested-child/input.scss | ||
@use "sass:meta"; | ||
|
||
@mixin foo() { | ||
@if false { | ||
@content; | ||
} | ||
} | ||
|
||
a {b: meta.accepts-content(meta.get-mixin("foo"))} | ||
|
||
<===> accepts/nested-child/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> doesnt-accept/empty/input.scss | ||
@use "sass:meta"; | ||
@mixin foo() {} | ||
|
||
a {b: meta.accepts-content(meta.get-mixin("foo"))} | ||
|
||
<===> doesnt-accept/empty/output.css | ||
a { | ||
b: false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// todo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// todo |
137 changes: 137 additions & 0 deletions
137
spec/core_functions/meta/get_mixin/different_module.hrx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<===> | ||
================================================================================ | ||
<===> defined/input.scss | ||
@use "sass:meta"; | ||
@use "foo"; | ||
a {@include meta.apply(meta.get-mixin("foo", $module: "color"), #abcdef)} | ||
|
||
<===> chosen_prefix/foo.scss | ||
@mixin foo($color) { | ||
b: red($color) | ||
} | ||
|
||
<===> defined/output.css | ||
a { | ||
b: 171; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> chosen_prefix/input.scss | ||
@use "sass:meta"; | ||
@use "foo" as a; | ||
b {@include meta.apply(meta.get-mixin("foo", $module: "a"), #abcdef)} | ||
|
||
<===> chosen_prefix/foo.scss | ||
@mixin foo($color) { | ||
c: red($color) | ||
} | ||
|
||
<===> chosen_prefix/output.css | ||
b { | ||
c: 171; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> through_use/input.scss | ||
@use "sass:meta"; | ||
@use "other" as *; | ||
a {@include meta.apply(meta.get-mixin(add-two), 10)} | ||
|
||
<===> through_use/other.scss | ||
@mixin add-two($v) {b: $v + 2} | ||
|
||
<===> through_use/output.css | ||
a { | ||
b: 12; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> through_forward/bare/input.scss | ||
@use "sass:meta"; | ||
@use "midstream" as *; | ||
a {@include meta.apply(meta.get-mixin(c))} | ||
|
||
<===> through_forward/bare/_midstream.scss | ||
@forward "upstream"; | ||
|
||
<===> through_forward/bare/_upstream.scss | ||
@mixin c() {b: c} | ||
|
||
<===> through_forward/bare/output.css | ||
a { | ||
b: c; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> through_forward/as/input.scss | ||
@use "sass:meta"; | ||
@use "midstream" as *; | ||
a {@include meta.apply(meta.get-mixin(c-d))} | ||
|
||
<===> through_forward/as/_midstream.scss | ||
@forward "upstream" as c-*; | ||
|
||
<===> through_forward/as/_upstream.scss | ||
@mixin d() {b: d} | ||
|
||
<===> through_forward/as/output.css | ||
a { | ||
b: d; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> through_forward/show/input.scss | ||
@use "sass:meta"; | ||
@use "midstream" as *; | ||
a {@include meta.apply(meta.get-mixin(c))} | ||
|
||
<===> through_forward/show/_midstream.scss | ||
@forward "upstream" show c; | ||
|
||
<===> through_forward/show/_upstream.scss | ||
@mixin c() {b: c} | ||
|
||
<===> through_forward/show/output.css | ||
a { | ||
b: c; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> through_forward/hide/input.scss | ||
@use "sass:meta"; | ||
@use "midstream" as *; | ||
a {@include meta.apply(meta.get-mixin(d))} | ||
|
||
<===> through_forward/hide/_midstream.scss | ||
@forward "upstream" hide c; | ||
|
||
<===> through_forward/hide/_upstream.scss | ||
@mixin d() {b: d} | ||
|
||
<===> through_forward/hide/output.css | ||
a { | ||
b: d; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> named/input.scss | ||
@use "sass:meta"; | ||
@use "foo"; | ||
a {@include meta.apply(meta.get-mixin($name: "foo", $module: "color"), #abcdef)} | ||
|
||
<===> named/foo.scss | ||
@mixin foo($color) { | ||
b: red($color) | ||
} | ||
|
||
<===> named/output.css | ||
a { | ||
b: 171; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<===> same_value/input.scss | ||
@use "sass:meta"; | ||
@mixin foo() {} | ||
$a: meta.get-mixin(foo); | ||
a {b: $a == $a} | ||
|
||
<===> same_value/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> built_in/same/input.scss | ||
@use "sass:meta"; | ||
a {b: meta.get-mixin(load-css, meta) == meta.get-mixin(load-css, meta)} | ||
|
||
<===> built_in/same/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> built_in/different/input.scss | ||
@use "sass:meta"; | ||
@mixin foo() {} | ||
a {b: meta.get-mixin(load-css, meta) == meta.get-mixin(foo)} | ||
|
||
<===> built_in/different/output.css | ||
a { | ||
b: false; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> user_defined/same/input.scss | ||
@use "sass:meta"; | ||
@mixin user-defined() {} | ||
a {b: meta.get-mixin(user-defined) == meta.get-mixin(user-defined)} | ||
|
||
<===> user_defined/same/output.css | ||
a { | ||
b: true; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> user_defined/different/input.scss | ||
@use "sass:meta"; | ||
@mixin user-defined-1() {} | ||
@mixin user-defined-2() {} | ||
a {b: meta.get-mixin(user-defined-1) == meta.get-mixin(user-defined-2)} | ||
|
||
<===> user_defined/different/output.css | ||
a { | ||
b: false; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> user_defined/redefined/input.scss | ||
@use "sass:meta"; | ||
@mixin user-defined() {} | ||
$first-reference: meta.get-mixin(user-defined); | ||
|
||
@mixin user-defined() {} | ||
$second-reference: meta.get-mixin(user-defined); | ||
a {b: $first-reference == $second-reference} | ||
|
||
<===> user_defined/redefined/output.css | ||
a { | ||
b: false; | ||
} |
Oops, something went wrong.