//
// @file
//
// Custom mixins where Bootstrap mixins fall short.
//

// Gradients.
#gradient {
  // Horizontal 3-color gradient.
  .horizontal-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
    background-color: mix(@midColor, @endColor, 80%);
    background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
    background-image: -webkit-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background-image: -moz-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background-image: -ms-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background-image: -o-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background-image: linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background-repeat: no-repeat;
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",@startColor,@endColor)); // IE9 and down, gets no color-stop at all for proper fallback
  }

  // Use these for the following behaviour:
  // If browser supports the gradient syntax it will *replace the background
  // color* behind it, and is *especially important for translucent gradients*.
  .horizontal-replace(@startColor: #555, @endColor: #333) {
    background: @endColor;
    background: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
    background: -ms-linear-gradient(left, @startColor, @endColor); // IE10
    background: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
    background: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
    background: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
    background: linear-gradient(left, @startColor, @endColor); // Le standard
    background-repeat: repeat-x;
  }
  .vertical-replace(@startColor: #555, @endColor: #333) {
    background: mix(@startColor, @endColor, 60%);
    background: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
    background: -ms-linear-gradient(top, @startColor, @endColor); // IE10
    background: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
    background: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
    background: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
    background: linear-gradient(top, @startColor, @endColor); // The standard
    background-repeat: repeat-x;
  }
  .vertical-three-colors-replace(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
    background: mix(@midColor, @endColor, 80%);
    background: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
    background: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
    background: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
    background: -ms-linear-gradient(@startColor, @midColor @colorStop, @endColor);
    background: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
    background: linear-gradient(@startColor, @midColor @colorStop, @endColor);
    background-repeat: no-repeat;
  }
  .horizontal-three-colors-replace(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
    background: mix(@midColor, @endColor, 80%);
    background: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
    background: -webkit-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background: -moz-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background: -ms-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background: -o-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background: linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
    background-repeat: no-repeat;
  }
}
