diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bdde4f..6831f9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 0.9.1 - - fix issue in which `@at-root` would panic when placed after a ruleset + - fix regression in which `@at-root` would panic when placed after a ruleset + - fix regression related to `@mixin` scoping and outer, local variables # 0.9.0 diff --git a/src/parse/mixin.rs b/src/parse/mixin.rs index e40102d..32b589c 100644 --- a/src/parse/mixin.rs +++ b/src/parse/mixin.rs @@ -116,6 +116,8 @@ impl<'a> Parser<'a> { } .parse()?; + self.scopes.pop(); + Ok(body) } diff --git a/tests/mixins.rs b/tests/mixins.rs index c92e338..a5cf865 100644 --- a/tests/mixins.rs +++ b/tests/mixins.rs @@ -242,3 +242,8 @@ test!( "@mixin c {}\n\na {\n @include c()\n}\n", "" ); +test!( + local_variable_declared_before_mixin_is_still_in_scope, + "@mixin foo {}\n\na {\n $a: red;\n @include foo;\n color: $a;\n}\n", + "a {\n color: red;\n}\n" +);