UNPKG

1.83 kBSCSSView Raw
1// TODO(jelbourn): Measure perf benefits for translate3d and will-change.
2// TODO(jelbourn): Figure out if anchor hover underline actually happens in any browser.
3
4@import 'button-base';
5
6// TODO(kara): Replace attribute selectors with class selectors when possible
7[md-button], [md-icon-button] {
8 @extend %md-button-base;
9
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
16 &[disabled]:hover {
17 &.md-primary, &.md-accent, &.md-warn, &::after {
18 background-color: transparent;
19 }
20 }
21}
22
23[md-raised-button] {
24 @extend %md-raised-button;
25}
26
27[md-fab] {
28 @include md-fab($md-fab-size, $md-fab-padding);
29}
30
31[md-mini-fab] {
32 @include md-fab($md-mini-fab-size, $md-mini-fab-padding);
33}
34
35[md-icon-button] {
36 @extend %md-button-base;
37
38 min-width: 0;
39 padding: 0;
40
41 width: $md-icon-button-size;
42 height: $md-icon-button-size;
43
44 line-height: $md-icon-button-line-height;
45 border-radius: $md-icon-button-border-radius;
46
47 .md-button-wrapper > * {
48 vertical-align: middle;
49 }
50}
51
52// The ripple container should match the bounds of the entire button.
53.md-button-ripple {
54 position: absolute;
55 top: 0;
56 left: 0;
57 bottom: 0;
58 right: 0;
59}
60
61// For round buttons, the ripple container should clip child ripples to a circle.
62.md-button-ripple-round {
63 border-radius: 50%;
64 // z-index needed to make clipping to border-radius work correctly.
65 // http://stackoverflow.com/questions/20001515/chrome-bug-border-radius-not-clipping-contents-when-combined-with-css-transiti
66 z-index: 1;
67}
68
69// Applies a clearer border for high-contrast mode (a11y)
70@media screen and (-ms-high-contrast: active) {
71 .md-raised-button, .md-fab, .md-mini-fab {
72 border: 1px solid #fff;
73 }
74}