1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-05 13:17:32 +02:00

IE8 compatible fix for disabled button hover

This commit is contained in:
Vickash Mahabir
2013-01-19 19:32:55 -04:00
parent b741c731a2
commit c77a459b35
2 changed files with 108 additions and 40 deletions

View File

@@ -1661,91 +1661,151 @@ input[type="button"].btn-block {
border-color: #a7a9aa; border-color: #a7a9aa;
} }
fieldset:not([disabled]) .btn:not([disabled]):not(.disabled):hover, .btn:hover,
.btn:not([disabled]):not(.disabled):hover, .btn:focus,
fieldset:not([disabled]) .btn:not([disabled]):not(.disabled):focus, .btn:active {
.btn:not([disabled]):not(.disabled):focus,
fieldset:not([disabled]) .btn:not([disabled]):not(.disabled):active,
.btn:not([disabled]):not(.disabled):active {
background-color: #9a9c9d; background-color: #9a9c9d;
border-color: #8d9091; border-color: #8d9091;
} }
.btn.disabled:hover,
.btn[disabled]:hover,
fieldset[disabled] .btn:hover,
.btn.disabled:focus,
.btn[disabled]:focus,
fieldset[disabled] .btn:focus,
.btn.disabled:active,
.btn[disabled]:active,
fieldset[disabled] .btn:active {
background-color: #a7a9aa;
border-color: #a7a9aa;
}
.btn-primary { .btn-primary {
background-color: #428bca; background-color: #428bca;
border-color: #428bca; border-color: #428bca;
} }
fieldset:not([disabled]) .btn-primary:not([disabled]):not(.disabled):hover, .btn-primary:hover,
.btn-primary:not([disabled]):not(.disabled):hover, .btn-primary:focus,
fieldset:not([disabled]) .btn-primary:not([disabled]):not(.disabled):focus, .btn-primary:active {
.btn-primary:not([disabled]):not(.disabled):focus,
fieldset:not([disabled]) .btn-primary:not([disabled]):not(.disabled):active,
.btn-primary:not([disabled]):not(.disabled):active {
background-color: #357ebd; background-color: #357ebd;
border-color: #3071a9; border-color: #3071a9;
} }
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active {
background-color: #428bca;
border-color: #428bca;
}
.btn-warning { .btn-warning {
background-color: #f0ad4e; background-color: #f0ad4e;
border-color: #f0ad4e; border-color: #f0ad4e;
} }
fieldset:not([disabled]) .btn-warning:not([disabled]):not(.disabled):hover, .btn-warning:hover,
.btn-warning:not([disabled]):not(.disabled):hover, .btn-warning:focus,
fieldset:not([disabled]) .btn-warning:not([disabled]):not(.disabled):focus, .btn-warning:active {
.btn-warning:not([disabled]):not(.disabled):focus,
fieldset:not([disabled]) .btn-warning:not([disabled]):not(.disabled):active,
.btn-warning:not([disabled]):not(.disabled):active {
background-color: #eea236; background-color: #eea236;
border-color: #ec971f; border-color: #ec971f;
} }
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled:active,
.btn-warning[disabled]:active,
fieldset[disabled] .btn-warning:active {
background-color: #f0ad4e;
border-color: #f0ad4e;
}
.btn-danger { .btn-danger {
background-color: #d9534f; background-color: #d9534f;
border-color: #d9534f; border-color: #d9534f;
} }
fieldset:not([disabled]) .btn-danger:not([disabled]):not(.disabled):hover, .btn-danger:hover,
.btn-danger:not([disabled]):not(.disabled):hover, .btn-danger:focus,
fieldset:not([disabled]) .btn-danger:not([disabled]):not(.disabled):focus, .btn-danger:active {
.btn-danger:not([disabled]):not(.disabled):focus,
fieldset:not([disabled]) .btn-danger:not([disabled]):not(.disabled):active,
.btn-danger:not([disabled]):not(.disabled):active {
background-color: #d43f3a; background-color: #d43f3a;
border-color: #c9302c; border-color: #c9302c;
} }
.btn-danger.disabled:hover,
.btn-danger[disabled]:hover,
fieldset[disabled] .btn-danger:hover,
.btn-danger.disabled:focus,
.btn-danger[disabled]:focus,
fieldset[disabled] .btn-danger:focus,
.btn-danger.disabled:active,
.btn-danger[disabled]:active,
fieldset[disabled] .btn-danger:active {
background-color: #d9534f;
border-color: #d9534f;
}
.btn-success { .btn-success {
background-color: #5cb85c; background-color: #5cb85c;
border-color: #5cb85c; border-color: #5cb85c;
} }
fieldset:not([disabled]) .btn-success:not([disabled]):not(.disabled):hover, .btn-success:hover,
.btn-success:not([disabled]):not(.disabled):hover, .btn-success:focus,
fieldset:not([disabled]) .btn-success:not([disabled]):not(.disabled):focus, .btn-success:active {
.btn-success:not([disabled]):not(.disabled):focus,
fieldset:not([disabled]) .btn-success:not([disabled]):not(.disabled):active,
.btn-success:not([disabled]):not(.disabled):active {
background-color: #4cae4c; background-color: #4cae4c;
border-color: #449d44; border-color: #449d44;
} }
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled:active,
.btn-success[disabled]:active,
fieldset[disabled] .btn-success:active {
background-color: #5cb85c;
border-color: #5cb85c;
}
.btn-info { .btn-info {
background-color: #5bc0de; background-color: #5bc0de;
border-color: #5bc0de; border-color: #5bc0de;
} }
fieldset:not([disabled]) .btn-info:not([disabled]):not(.disabled):hover, .btn-info:hover,
.btn-info:not([disabled]):not(.disabled):hover, .btn-info:focus,
fieldset:not([disabled]) .btn-info:not([disabled]):not(.disabled):focus, .btn-info:active {
.btn-info:not([disabled]):not(.disabled):focus,
fieldset:not([disabled]) .btn-info:not([disabled]):not(.disabled):active,
.btn-info:not([disabled]):not(.disabled):active {
background-color: #46b8da; background-color: #46b8da;
border-color: #31b0d5; border-color: #31b0d5;
} }
.btn-info.disabled:hover,
.btn-info[disabled]:hover,
fieldset[disabled] .btn-info:hover,
.btn-info.disabled:focus,
.btn-info[disabled]:focus,
fieldset[disabled] .btn-info:focus,
.btn-info.disabled:active,
.btn-info[disabled]:active,
fieldset[disabled] .btn-info:active {
background-color: #5bc0de;
border-color: #5bc0de;
}
.btn-link, .btn-link,
.btn-link:active, .btn-link:active,
.btn-link[disabled], .btn-link[disabled],

View File

@@ -111,13 +111,21 @@ input[type="button"] {
// Mixin for darkening only enabled buttons for link states // Mixin for darkening only enabled buttons for link states
.darken-button-states (@background, @border) { .darken-button-states (@background, @border) {
fieldset:not([disabled]) &:not([disabled]):not(.disabled), &:hover,
&:not([disabled]):not(.disabled) { &:focus,
&:active {
background-color: darken(@background, 5%);
border-color: darken(@border, 10%);
}
&.disabled,
&[disabled],
fieldset[disabled] & {
&:hover, &:hover,
&:focus, &:focus,
&:active { &:active {
background-color: darken(@background, 5%); background-color: @background;
border-color: darken(@border, 10%); border-color: @border
} }
} }
} }