2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-14 18:42:30 +03:00

Revamp button mixins and pseudo states

* Remove .darken-button-states and .buttonBackground mixins (latter wasn't being used anyway)
* Create new .btn-pseudo-states mixin for setting button background and border colors for default and pseudo states
This commit is contained in:
Mark Otto
2013-02-02 19:16:15 -08:00
parent 2f7087eae9
commit 9480eb89cb
2 changed files with 25 additions and 55 deletions
+19 -17
View File
@@ -383,31 +383,33 @@
border-bottom: 1px solid @bottom;
}
// Button backgrounds
// ------------------
.buttonBackground(@background-start, @background-end, @text-color: #fff, @text-shadow: 0 -1px 0 rgba(0,0,0,.25)) {
color: @text-color;
text-shadow: @text-shadow;
#gradient > .vertical(@background-start, @background-end);
border-color: darken(@background-end, 7.5%);
// Button psuedo states
// -------------------------
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
.btn-pseudo-states(@background, @border) {
background-color: @background;
border-color: @border;
&:hover,
&:active,
&.active {
color: @text-color;
background-color: @background-end;
background-position: 0 -15px;
&:focus,
&:active {
background-color: darken(@background, 5%);
border-color: darken(@border, 10%);
}
&:active,
&.active,
&[disabled],
&.disabled,
&[disabled],
fieldset[disabled] & {
background-image: none;
&:hover,
&:focus,
&:active {
background-color: @background;
border-color: @border
}
}
}
// Navbar vertical align
// -------------------------
// Vertically center elements in the navbar.