@gradient: 'false';

.gradientBar(@primaryColor, @secondaryColor, @textColor: #fff) {
	color: @textColor;
	.gradient(@primaryColor, @secondaryColor, @gradient);
	border-color: @primaryColor @primaryColor darken(@primaryColor, 10%);
}

// Gradients
.gradient(@startColor: #555, @endColor: #333, @gradient) when not (@gradient) {
	background-color: @startColor;
}

.gradient(@startColor: #555, @endColor: #333, @gradient) when (@gradient) {
	background-color: mix(@startColor, @endColor, 60%);
	background-image: -moz-linear-gradient(top, @startColor, @endColor);
	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor));
	background-image: -webkit-linear-gradient(top, @startColor, @endColor);
	background-image: -o-linear-gradient(top, @startColor, @endColor);
	background-image: linear-gradient(to bottom, @startColor, @endColor);
	background-repeat: repeat-x;
	filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor)));
}

// Button Background
.buttonBackground(@startColor, @endColor, @textColor: #fff) when not (@gradient) {
	.gradientBar(@startColor, @endColor, @textColor);

	&:hover {
		border-color: lighten(@startColor, 5%) lighten(@startColor, 5%) darken(@startColor, 5%);
		background-color: lighten(@startColor, 5%);
	}

	&:active, &:focus, &:active:hover, &:active:focus {
		border-color: darken(@startColor, 5%) darken(@startColor, 5%) darken(@startColor, 5%);
		background-color: darken(@startColor, 5%);
	}

	&.dropdown-toggle {
		border-left-color: darken(@startColor, 5%);
	}

	&[disabled] {
		&,
		&:hover,
		&:active,
		&:focus {
			border-color: lighten(@startColor, 20%);
			background-color: lighten(@startColor, 20%);
		}
	}
}

.buttonBackground(@startColor, @endColor, @textColor: #fff) when (@gradient) {
	.gradientBar(@startColor, @endColor, @textColor);

	&:hover {
		border-color: @endColor @endColor darken(@endColor, 10%);
		background-color: lighten(@endColor, 5%);
	}

	&:active, &:focus, &:active:hover, &:active:focus {
		border-color: darken(@startColor, 10%) darken(@startColor, 10%) darken(@startColor, 20%);
		background-color: darken(@startColor, 10%);
	}

	&.dropdown-toggle {
		border-left-color: darken(@startColor, 5%);
	}

	&[disabled] {
		&,
		&:hover,
		&:active,
		&:focus {
			border-color: lighten(@startColor, 20%);
			background-color: lighten(@startColor, 20%);
		}
	}
}

// Drop shadows
.box-shadow(@shadow) {
  -webkit-box-shadow: @shadow;
     -moz-box-shadow: @shadow;
          box-shadow: @shadow;
}