$x: 0;

div {
  /* 0 */
  font: $x;
  $x: 1;
  /* 1 */
  font: $x;
  span {
    $x: 2;
    /* 2 */
    font: $x;
  }
  /* 2 */
  font: $x;
  p {
    /* 2 */
    font: $x;
  }
}

div {
  @foo {
    $y: 2;
    font: $y;
  }
  @bar {
    $y: 3;
    font: $y;
  }
}

@mixin foo() {
  content: "foo";
  @content;
}

div {
  $z: "whatever";
  @include foo() {
    $z: "block for foo!";
    font: fudge;
  }
  width: $z;
}