unconditionally exit mixin scope
This commit is contained in:
parent
a3ebcb298a
commit
3c756f661d
@ -145,10 +145,10 @@ impl<'a> Parser<'a> {
|
||||
.parse()?;
|
||||
|
||||
self.content.pop();
|
||||
self.scopes.exit_scope();
|
||||
|
||||
if declared_at_root {
|
||||
mem::swap(self.scopes, self.content_scopes);
|
||||
} else {
|
||||
self.scopes.exit_scope();
|
||||
}
|
||||
|
||||
Ok(body)
|
||||
|
@ -426,3 +426,26 @@ test!(
|
||||
}",
|
||||
"a {\n color: 1rem;\n}\n"
|
||||
);
|
||||
test!(
|
||||
can_access_global_variables_set_after_other_include,
|
||||
"$x: true;
|
||||
|
||||
@mixin foobar() {
|
||||
@if $x {
|
||||
$x: false !global;
|
||||
color: foo;
|
||||
}
|
||||
|
||||
@else {
|
||||
$x: true !global;
|
||||
color: bar;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
@include foobar();
|
||||
$x: true !global;
|
||||
@include foobar();
|
||||
}",
|
||||
"a {\n color: foo;\n color: foo;\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user