@function _long-shadow($bgcolor: #fff, $length: 100px, $opacity: 0.1, $strength: 0, $light: $_global-light) {

  @if unit($length) == "px" or unitless($length) {
    $length: _strip-unit($length);
  }
  @else {
    @warn "Invalid unit #{$length}! Please use pixels";
  }

  $shadow-list: null;

  $x: 1;
  $y: 1;

  $l: _light-source($light);

  @for $i from 1 through $length {
    $o: ($opacity - (($opacity - ($opacity * $strength)) * ($i * 100 / $length) / 100)) * 100%;

    $x: nth($l, 1) * $i;
    $y: nth($l, 2) * $i;

    $shadow-list: append($shadow-list, mix(black, $bgcolor, $o) $x $y 0, comma);
  }

  @if alpha($bgcolor) < 1 {
    @warn "No alpha allowed (#{$bgcolor})!";
    @return null;
  }
  @else {
    @return $shadow-list;
  }
}

// For when you don't need any other shadows on the element
@mixin _long-box-shadow($bgcolor: #fff, $length: 100px, $opacity: 0.1, $strength: 0, $light: $_global-light) {
  box-shadow: _long-shadow($bgcolor, $length, $opacity, $strength, $light);
}

@mixin _long-text-shadow($bgcolor: #fff, $length: 100px, $opacity: 0.1, $strength: 0, $light: $_global-light) {
  text-shadow: _long-shadow($bgcolor, $length, $opacity, $strength, $light);
}
