Skip to content

Commit

Permalink
fix(button): hover styles being applied to disabled buttons
Browse files Browse the repository at this point in the history
Fixes the button hover styles being applied, even if a button is disabled.

Fixes angular#866.
  • Loading branch information
crisbeto committed Jul 25, 2016
1 parent 16eb6be commit 2945e83
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
@import 'button-base';

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

// Only flat buttons and icon buttons (not raised or fabs) have a hover style.
&:hover {
// Use the same visual treatment for hover as for focus.
@include md-button-focus();
}

&[disabled]:hover {
&.md-primary, &.md-accent, &.md-warn, &:hover {
&.md-primary, &.md-accent, &.md-warn, &::after {
background-color: transparent;
}
}
Expand Down Expand Up @@ -43,12 +49,6 @@
}
}

// Only flat buttons and icon buttons (not raised or fabs) have a hover style.
[md-button]:hover, [md-icon-button]:hover {
// Use the same visual treatment for hover as for focus.
@include md-button-focus();
}

// Applies a clearer border for high-contrast mode (a11y)
@media screen and (-ms-high-contrast: active) {
.md-raised-button, .md-fab, .md-mini-fab {
Expand Down

0 comments on commit 2945e83

Please sign in to comment.