// Gradient Bar Colors for buttons and alerts
.gradientBar(@primaryColor, @secondaryColor) {
  #gradient > .vertical(@primaryColor, @secondaryColor);
  text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
  border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
}

#gradient {
  .horizontal(@startColor: #555, @endColor: #333) {
    background-color: @endColor;
    background-repeat: repeat-x;
    background-image: linear-gradient(to right, @startColor, @endColor);

    // Internet Explorer <= 9
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)", @startColor, @endColor));
  }

  .vertical(@startColor: #555, @endColor: #333) {
    background-color: @endColor;
    background-repeat: repeat-x;
    background-image: linear-gradient(to bottom, @startColor, @endColor);

    // Internet Explorer <= 9
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", @startColor, @endColor));
  }

  .directional(@startColor: #555, @endColor: #333, @deg: 45deg) {
    background-color: @endColor;
    background-repeat: repeat-x;
    background-image: linear-gradient(@deg, @startColor, @endColor);
  }

  .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6,
                         @colorStop: 50%, @endColor: #c3325f) {
    background-color: @endColor;
    background-repeat: no-repeat;
    background-image: linear-gradient(to bottom, @startColor, @midColor @colorStop,
                                      @endColor);

    // Internet Explorer <= 9
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", @startColor, @endColor));
  }
}

/*
 * Resets all gradient filters on an element in Internet Explorer.
 */
.ie-reset-gradients() {
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
}
