twbs--bootstrap/less/buttons.less

149 lines
3.1 KiB
Plaintext
Raw Normal View History

// BUTTON STYLES
// -------------
// Colors
// ------
.btn {
// Set text color
&.primary,
&.primary:hover,
&.warning,
&.warning:hover,
&.danger,
&.danger:hover,
&.success,
&.success:hover,
&.info,
&.info:hover {
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
color: @white
}
&.primary.active,
&.warning.active,
&.danger.active,
&.success.active,
&.info.active {
color: rgba(255,255,255,.75);
}
&.primary {
.buttonBackground(@primaryButtonBackground, spin(@primaryButtonBackground, 20));
}
// Warning appears are orange
&.warning {
.buttonBackground(lighten(@orange, 15%), @orange);
}
// Danger and error appear as red
&.danger {
.buttonBackground(#ee5f5b, #bd362f);
}
// Success appears as green
&.success {
.buttonBackground(#62c462, #51a351);
}
// Info appears as a neutral blue
&.info {
.buttonBackground(#5bc0de, #2f96b4);
}
}
// Base styles
// -----------
.btn {
// Button Base
display: inline-block;
padding: 4px 10px 4px;
font-size: @baseFontSize;
line-height: @baseLineHeight;
2012-01-21 23:24:06 +00:00
color: @grayDark;
text-align: center;
text-shadow: 0 1px 1px rgba(255,255,255,.75);
2012-01-21 23:24:06 +00:00
#gradient > .vertical-three-colors(@white, @white, 25%, darken(@white, 10%)); // Don't use .gradientbar() here since it does a three-color gradient
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;
.ie7-restore-left-whitespace();
&:hover {
color: @grayDark;
text-decoration: none;
background-color: darken(@white, 10%);
background-position: 0 -15px;
// 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);
}
// Focus state for keyboard and accessibility
&:focus {
2012-01-28 02:33:25 +00:00
.tab-focus();
}
// Active and Disabled states
&.active,
&:active {
background-image: none;
@shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
.box-shadow(@shadow);
background-color: darken(@white, 10%);
background-color: darken(@white, 15%) e("\9");
color: rgba(0,0,0,.5);
outline: 0;
}
&.disabled,
&[disabled] {
cursor: default;
background-image: none;
background-color: darken(@white, 10%);
.opacity(65);
.box-shadow(none);
}
// Button Sizes
&.large {
padding: 9px 14px;
font-size: @baseFontSize + 2px;
line-height: normal;
2012-01-09 05:48:07 +00:00
.border-radius(5px);
}
2012-01-26 22:36:30 +00:00
&.large .icon {
margin-top: 1px;
}
&.small {
padding: 5px 9px;
font-size: @baseFontSize - 2px;
line-height: @baseLineHeight - 2px;
}
2012-01-26 21:51:12 +00:00
&.small .icon {
margin-top: -1px;
2012-01-26 21:51:12 +00: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;
}
// IE7 has some default padding on button controls
*padding-top: 2px;
*padding-bottom: 2px;
&.large {
*padding-top: 7px;
*padding-bottom: 7px;
}
&.small {
*padding-top: 3px;
*padding-bottom: 3px;
}
}