Skip to content

Commit 5b6c2cf

Browse files
committed
fix(button): hover styles being applied to disabled buttons
Fixes the button hover styles being applied, even if a button is disabled. Fixes #866.
1 parent 16eb6be commit 5b6c2cf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/components/button/button.scss

Lines changed: 8 additions & 8 deletions
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
}
@@ -43,12 +49,6 @@
4349
}
4450
}
4551

46-
// Only flat buttons and icon buttons (not raised or fabs) have a hover style.
47-
[md-button]:hover, [md-icon-button]:hover {
48-
// Use the same visual treatment for hover as for focus.
49-
@include md-button-focus();
50-
}
51-
5252
// Applies a clearer border for high-contrast mode (a11y)
5353
@media screen and (-ms-high-contrast: active) {
5454
.md-raised-button, .md-fab, .md-mini-fab {

0 commit comments

Comments
 (0)