<===> input.scss
@mixin test() {
  @at-root {
    @include foo();
  }
}

@mixin foo() {
  #{'.foo'} {
    bar: baz;
  }
}

.test {
  @include test();
}

<===> output.css
.foo {
  bar: baz;
}