/* Mixins to extend what Compass provides */

=animation($values...)
  -webkit-animation: $values
  -moz-animation: $values
  -o-animation: $values
  -ms-animation: $values
  animation: $values

=text-fill-color($value)
  -webkit-text-fill-color: $value
  -moz-text-fill-color: $value
  -o-text-fill-color: $value
  -ms-text-fill-color: $value
  text-fill-color: $value

=text-stroke-color($value)
  -webkit-stroke-fill-color: $value
  -moz-stroke-fill-color: $value
  -o-stroke-fill-color: $value
  -ms-stroke-fill-color: $value
  stroke-fill-color: $value

=text-stroke-width($value)
  -webkit-text-stroke-width: $value
  -moz-text-stroke-width: $value
  -o-text-stroke-width: $value
  -ms-text-stroke-width: $value
  text-stroke-width: $value

//============================================================
//
// arrow
//
// @param width           :  px, em
// @param height          :  px, em
// @param direction       :  up, down, left, right
// @param color           :  hex, rgb
//
//============================================================

=arrow($width: 20px, $height: 20px, $direction: up, $color: red)
  
  width: 0 
  height: 0
  
  // Right
  @if $direction == right
    border-top: $height/2 solid transparent
    border-bottom: $height/2 solid transparent
    border-left: $width solid $color

  // Left
  @if $direction == left
    border-top: $height/2 solid transparent
    border-bottom: $height/2 solid transparent
    border-right: $width solid $color

  // Up
  @if $direction == up
    border-left: $width/2 solid transparent
    border-right: $width/2 solid transparent
    border-bottom: $height solid $color

  // Down
  @if $direction == down
    border-left: $width/2 solid transparent
    border-right: $width/2 solid transparent
    border-top: $height solid $color



// 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: $experimental-support-for-microsoft, $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