Functions and control directives

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 v3.2.3

$font-size: 16;

@function em($target, $context: $font_size) {
    @return ($target / $context) * 1em;

@mixin foo($target) {
    font-size: em($target);

block {
    @include foo(12);


block {
  font-size: 0.75em;

See SassMeister Gist