Skip to content

Commit 27f3d94

Browse files
crisbetojelbourn
authored andcommitted
fix(button): hover styles being applied to disabled buttons (angular#909)
Fixes the button hover styles being applied, even if a button is disabled. Fixes angular#866.
1 parent 92e390e commit 27f3d94

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/components/button/button.scss

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
@import 'button-base';
55

66
// TODO(kara): Replace attribute selectors with class selectors when possible
7-
[md-button] {
7+
[md-button], [md-icon-button] {
88
@extend %md-button-base;
99

10+
// Only flat buttons and icon buttons (not raised or fabs) have a hover style.
11+
&:hover {
12+
// Use the same visual treatment for hover as for focus.
13+
@include md-button-focus();
14+
}
15+
1016
&[disabled]:hover {
11-
&.md-primary, &.md-accent, &.md-warn, &:hover {
17+
&.md-primary, &.md-accent, &.md-warn, &::after {
1218
background-color: transparent;
1319
}
1420
}
@@ -60,12 +66,6 @@
6066
z-index: 1;
6167
}
6268

63-
// Only flat buttons and icon buttons (not raised or fabs) have a hover style.
64-
[md-button]:hover, [md-icon-button]:hover {
65-
// Use the same visual treatment for hover as for focus.
66-
@include md-button-focus();
67-
}
68-
6969
// Applies a clearer border for high-contrast mode (a11y)
7070
@media screen and (-ms-high-contrast: active) {
7171
.md-raised-button, .md-fab, .md-mini-fab {

0 commit comments

Comments
 (0)