/**
 *
 * Safari browser mixins
 *
**/

/**
 * safari6_above_only (Safari ≥ 6.1)
 *
 * Usage:
 *
 * @include safari6_above_only(
 *   'selector',
 *   (
 *     property: value,
 *   )
 * );
 *
**/
@function sf_func1($selector, $property) {
  @return '@media screen and(min-color-index:0)and(-webkit-min-device-pixel-ratio:0){@media{'+& $selector+'{'+$property;
}

@function sf_func2($value) {
  @return $value+'}}}';
}

@mixin safari6_above_only($selector, $map) {
  $property: #{sf_func1($selector, $property)};
  $value: #{sf_func2($value)};

  @at-root {
    @each $property, $value in ($map) {
      $property: $value;
    }
  }
}

/**
 * safari9_above_only (Safari ≥ 9)
 *
 * Usage:
 *
 * @include safari9_above_only() {
 *   selector {
 *     property: value;
 *   }
 * }
 *
**/
@mixin safari9_above_only() {
  @supports (overflow: -webkit-marquee) and (justify-content: inherit) {
    @content;
  }
}
