// From https://github.com/ZeeAgency/compass-animation

// Requires SASS syntax and not SCSS in order to work (sass 3.2 ?)
// Experimental support is scoped within keyframes so for instance -moz-keyframes won't contain -webkit- properties


// Mixin to set every support to false
@reset-experimental-support
  $experimental-support-for-mozilla: false
  $experimental-support-for-webkit: false
  $experimental-support-for-opera: false
  $experimental-support-for-microsoft: false
  $experimental-support-for-khtml: false


@keyframes($name, $moz: $experimental-support-for-mozilla, $webkit: $experimental-support-for-webkit, $o: $experimental-support-for-opera, $ms: false, $khtml: $experimental-support-for-khtml, $official: true)

  // Save support
  $original-experimental-support-for-mozilla:   $experimental-support-for-mozilla
  $original-experimental-support-for-webkit:    $experimental-support-for-webkit
  $original-experimental-support-for-opera:     $experimental-support-for-opera
  $original-experimental-support-for-microsoft: $experimental-support-for-microsoft
  $original-experimental-support-for-khtml:     $experimental-support-for-khtml

  @if $moz
    +reset-experimental-support
    $experimental-support-for-mozilla: true

    @-moz-keyframes #{$name}
      @content


  @if $webkit

    +reset-experimental-support
    $experimental-support-for-webkit: true

    @-webkit-keyframes #{$name}
      @content

  @if $o

    +reset-experimental-support
    $experimental-support-for-opera: true

    @-o-keyframes #{$name}
      @content

  @if $ms

    +reset-experimental-support
    $experimental-support-for-microsoft: true

    @-ms-keyframes #{$name}
      @content

  @if $khtml

    +reset-experimental-support
    $experimental-support-for-khtml: true

    @-khtml-keyframes #{$name}
      @content

  // Restore support
  $experimental-support-for-mozilla:   $original-experimental-support-for-mozilla
  $experimental-support-for-webkit:    $original-experimental-support-for-webkit
  $experimental-support-for-opera:     $original-experimental-support-for-opera
  $experimental-support-for-microsoft: $original-experimental-support-for-microsoft
  $experimental-support-for-khtml:     $original-experimental-support-for-khtml

  @if $official
    @keyframes #{$name}
      @content