2012-01-05 13:01:42 -05:00
|
|
|
// BUTTON STYLES
|
|
|
|
// -------------
|
|
|
|
|
2012-01-26 14:10:07 -05:00
|
|
|
|
|
|
|
// Colors
|
|
|
|
// ------
|
|
|
|
|
2012-01-14 19:18:15 -05:00
|
|
|
.btn {
|
2012-01-05 13:01:42 -05:00
|
|
|
// Set text color
|
2012-01-26 13:01:03 -05:00
|
|
|
&.primary,
|
|
|
|
&.primary:hover,
|
2012-01-05 13:01:42 -05:00
|
|
|
&.danger,
|
|
|
|
&.danger:hover,
|
|
|
|
&.success,
|
|
|
|
&.success:hover,
|
|
|
|
&.info,
|
|
|
|
&.info:hover {
|
2012-01-05 18:43:07 -05:00
|
|
|
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
2012-01-05 13:01:42 -05:00
|
|
|
color: @white
|
|
|
|
}
|
2012-01-26 13:01:03 -05:00
|
|
|
&.primary {
|
|
|
|
.buttonBackground(@primaryButtonBackground, spin(@primaryButtonBackground, 15));
|
|
|
|
}
|
2012-01-05 13:01:42 -05:00
|
|
|
// Danger and error appear as red
|
2012-01-14 19:18:15 -05:00
|
|
|
&.danger {
|
2012-01-26 13:01:03 -05:00
|
|
|
.buttonBackground(#ee5f5b, #c43c35);
|
2012-01-05 13:01:42 -05:00
|
|
|
}
|
|
|
|
// Success appears as green
|
|
|
|
&.success {
|
2012-01-26 13:01:03 -05:00
|
|
|
.buttonBackground(#62c462, #57a957);
|
2012-01-05 13:01:42 -05:00
|
|
|
}
|
|
|
|
// Info appears as a neutral blue
|
|
|
|
&.info {
|
2012-01-26 13:01:03 -05:00
|
|
|
.buttonBackground(#5bc0de, #339bb9);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-26 14:10:07 -05:00
|
|
|
|
|
|
|
// Mixin for generating button backgrounds
|
|
|
|
// ---------------------------------------
|
2012-01-26 13:01:03 -05:00
|
|
|
.buttonBackground(@startColor, @endColor) {
|
|
|
|
// gradientBar will set the background to a pleasing blend of these, to support IE<=9
|
|
|
|
.gradientBar(@startColor, @endColor);
|
|
|
|
|
|
|
|
// in these cases the gradient won't cover the background, so we override
|
2012-01-26 13:51:03 -05:00
|
|
|
&:hover, &:active, &.active, &.disabled {
|
|
|
|
background-color: @endColor;
|
|
|
|
}
|
|
|
|
|
2012-01-26 14:10:07 -05:00
|
|
|
// called out separately because IE8 would ignore otherwise
|
2012-01-26 13:51:03 -05:00
|
|
|
&[disabled] {
|
2012-01-26 13:01:03 -05:00
|
|
|
background-color: @endColor;
|
|
|
|
}
|
|
|
|
|
2012-01-26 14:10:07 -05:00
|
|
|
// IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
|
2012-01-26 13:01:03 -05:00
|
|
|
&:active,
|
|
|
|
&.active {
|
|
|
|
background-color: darken(@endColor, 10%) e("\9");
|
2012-01-05 13:01:42 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-26 14:10:07 -05:00
|
|
|
|
|
|
|
// Base styles
|
|
|
|
// -----------
|
|
|
|
|
2012-01-05 13:01:42 -05:00
|
|
|
.btn {
|
|
|
|
// Button Base
|
|
|
|
display: inline-block;
|
2012-01-26 16:02:27 -05:00
|
|
|
padding: 4px 10px 4px;
|
2012-01-26 17:32:44 -05:00
|
|
|
*padding: 2px 10px;
|
|
|
|
// IE7 likes to collapse the whitespace before the button, so bring it back...
|
|
|
|
*margin-left: 4px;
|
|
|
|
&:first-child {
|
|
|
|
// ...but not before the first button
|
|
|
|
*margin-left: 0;
|
|
|
|
}
|
2012-01-05 13:01:42 -05:00
|
|
|
font-size: @baseFontSize;
|
2012-01-26 16:02:27 -05:00
|
|
|
line-height: @baseLineHeight;
|
2012-01-21 18:24:06 -05:00
|
|
|
color: @grayDark;
|
2012-01-05 13:01:42 -05:00
|
|
|
text-shadow: 0 1px 1px rgba(255,255,255,.75);
|
2012-01-21 18:24:06 -05:00
|
|
|
#gradient > .vertical-three-colors(@white, @white, 25%, darken(@white, 10%)); // Don't use .gradientbar() here since it does a three-color gradient
|
2012-01-05 13:01:42 -05:00
|
|
|
border: 1px solid #ccc;
|
|
|
|
border-bottom-color: #bbb;
|
|
|
|
.border-radius(4px);
|
|
|
|
@shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
|
|
|
|
.box-shadow(@shadow);
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: @grayDark;
|
|
|
|
text-decoration: none;
|
2012-01-26 13:01:03 -05:00
|
|
|
background-color: darken(@white, 10%);
|
2012-01-05 13:01:42 -05:00
|
|
|
background-position: 0 -15px;
|
2012-01-26 13:01:03 -05:00
|
|
|
|
|
|
|
// transition is only when going to hover, otherwise the background
|
|
|
|
// behind the gradient (there for IE<=9 fallback) gets mismatched
|
|
|
|
.transition(background-position .1s linear);
|
2012-01-05 13:01:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Focus state for keyboard and accessibility
|
|
|
|
&:focus {
|
|
|
|
outline: 1px dotted #666;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Active and Disabled states
|
|
|
|
&.active,
|
|
|
|
&:active {
|
2012-01-18 03:30:49 -05:00
|
|
|
background-image: none;
|
|
|
|
@shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
|
2012-01-05 13:01:42 -05:00
|
|
|
.box-shadow(@shadow);
|
2012-01-26 13:01:03 -05:00
|
|
|
background-color: darken(@white, 10%);
|
|
|
|
background-color: darken(@white, 15%) e("\9");
|
2012-01-05 13:01:42 -05:00
|
|
|
}
|
|
|
|
&.disabled {
|
|
|
|
cursor: default;
|
|
|
|
background-image: none;
|
2012-01-26 13:51:03 -05:00
|
|
|
background-color: darken(@white, 10%);
|
2012-01-05 13:01:42 -05:00
|
|
|
.opacity(65);
|
|
|
|
.box-shadow(none);
|
|
|
|
}
|
|
|
|
&[disabled] {
|
|
|
|
// disabled pseudo can't be included with .disabled
|
|
|
|
// def because IE8 and below will drop it ;_;
|
|
|
|
cursor: default;
|
|
|
|
background-image: none;
|
2012-01-26 13:51:03 -05:00
|
|
|
background-color: darken(@white, 10%);
|
2012-01-05 13:01:42 -05:00
|
|
|
.opacity(65);
|
|
|
|
.box-shadow(none);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Button Sizes
|
|
|
|
&.large {
|
|
|
|
padding: 9px 14px 9px;
|
|
|
|
font-size: @baseFontSize + 2px;
|
|
|
|
line-height: normal;
|
2012-01-09 00:48:07 -05:00
|
|
|
.border-radius(5px);
|
2012-01-05 13:01:42 -05:00
|
|
|
}
|
2012-01-26 17:36:30 -05:00
|
|
|
&.large .icon {
|
|
|
|
margin-top: 1px;
|
|
|
|
}
|
2012-01-05 13:01:42 -05:00
|
|
|
&.small {
|
2012-01-26 16:02:27 -05:00
|
|
|
padding: 5px 9px 5px;
|
2012-01-05 13:01:42 -05:00
|
|
|
font-size: @baseFontSize - 2px;
|
2012-01-26 16:02:27 -05:00
|
|
|
line-height: @baseLineHeight - 2px;
|
2012-01-05 13:01:42 -05:00
|
|
|
}
|
2012-01-26 16:51:12 -05:00
|
|
|
&.small .icon {
|
|
|
|
margin-top: -2px;
|
|
|
|
}
|
2012-01-05 13:01:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Help Firefox not be a jerk about adding extra padding to buttons
|
|
|
|
button.btn,
|
|
|
|
input[type=submit].btn {
|
|
|
|
&::-moz-focus-inner {
|
|
|
|
padding: 0;
|
|
|
|
border: 0;
|
|
|
|
}
|
2012-01-26 13:01:03 -05:00
|
|
|
}
|