@mixin foo() {
  /* begin foo */
  /* assigning to $x */
  $x: inside foo;
  x: $x;
  /* end foo */
}

outer {
  /* assigning to $x */
  $x: inside outer scope;
  blah: blah;
  inner {
    @include foo();
    x: $x;
  }
}