|
| 1 | +@import '../../material/core/style/layout-common'; |
| 2 | + |
1 | 3 | // Adds a `before` pseudo element that acts as an overlay indicator for interaction states |
2 | 4 | // such as focus, hover, and active. |
3 | 5 | @mixin _mat-button-interactive() { |
|
10 | 12 | bottom: 0; |
11 | 13 | left: 0; |
12 | 14 | opacity: 0; |
| 15 | + border-radius: inherit; |
13 | 16 | @content; |
14 | 17 | } |
15 | 18 | } |
16 | 19 |
|
| 20 | +// The ripple container should match the bounds of the entire button. |
| 21 | +// Increase specificity for the ripple container because ripple styles are part of |
| 22 | +// the `mat-core` mixin and can potentially overwrite the absolute position of the container. |
| 23 | +@mixin _mat-button-ripple-position() { |
| 24 | + .mat-mdc-button-ripple { |
| 25 | + @include mat-fill; |
| 26 | + |
| 27 | + // Disable pointer events for the ripple container and focus overlay because the container |
| 28 | + // will overlay the user content and we don't want to disable mouse events on the user content. |
| 29 | + // Pointer events can be safely disabled because the ripple trigger element is the host element. |
| 30 | + pointer-events: none; |
| 31 | + |
| 32 | + // Inherit the border radius from the parent so that focus overlay and ripples don't exceed the |
| 33 | + // parent button boundaries. Note that an inherited border radius does not work properly if |
| 34 | + // the actual button element does have a border because it causes the inner content to be |
| 35 | + // smaller. We have special logic for stroked buttons to handle this scenario. |
| 36 | + border-radius: inherit; |
| 37 | + } |
| 38 | +} |
| 39 | + |
17 | 40 | // MDC's disabled buttons define a default cursor with pointer-events none. However, they select |
18 | 41 | // :disabled for this, which does not affect anchor tags. |
19 | 42 | // TODO(andrewseguin): Discuss with the MDC team about a mixin we can call for applying this style, |
|
0 commit comments