0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Bootstrap/lib/buttons.less

120 lines
2.5 KiB
Plaintext

// BUTTON STYLES
// -------------
// Shared colors for buttons and alerts
.btn,
.alert-message {
// Set text color
&.danger,
&.danger:hover,
&.error,
&.error:hover,
&.success,
&.success:hover,
&.info,
&.info:hover {
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
color: @white
}
// Danger and error appear as red
&.danger,
&.error {
.gradientBar(#ee5f5b, #c43c35);
}
// Success appears as green
&.success {
.gradientBar(#62c462, #57a957);
}
// Info appears as a neutral blue
&.info {
.gradientBar(#5bc0de, #339bb9);
}
}
// Base .btn styles
.btn {
// Button Base
display: inline-block;
padding: 5px 10px 6px;
font-size: @baseFontSize;
line-height: normal;
color: #333;
text-shadow: 0 1px 1px rgba(255,255,255,.75);
#gradient > .vertical-three-colors(#ffffff, #ffffff, 25%, darken(#ffffff, 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;
&:hover {
color: @grayDark;
text-decoration: none;
background-position: 0 -15px;
}
// Focus state for keyboard and accessibility
&:focus {
outline: 1px dotted #666;
}
// Primary Button Type
&.primary {
color: @white;
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
.gradientBar(@blue, @blueDark)
}
// Transitions
.transition(.1s linear all);
// Active and Disabled states
&.active,
&:active {
@shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05);
.box-shadow(@shadow);
}
&.disabled {
cursor: default;
background-image: none;
.reset-filter();
.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;
.reset-filter();
.opacity(65);
.box-shadow(none);
}
// Button Sizes
&.large {
padding: 9px 14px 9px;
font-size: @baseFontSize + 2px;
line-height: normal;
.border-radius(6px);
}
&.small {
padding: 7px 9px 7px;
font-size: @baseFontSize - 2px;
}
}
// Super jank hack for removing border-radius from IE9 so we can keep filter gradients on alerts and buttons
:root .alert-message,
:root .btn {
border-radius: 0 \0;
}
// 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;
}
}