Fact: Mixins/functions may not be defined within control directives or other mixins.
Here is an best practice example for passing a value from a mixin into a function for the return
Sass
SassMeister-input.scss
CSS
SassMeister-output.css
See SassMeister Gist