File tree Expand file tree Collapse file tree 11 files changed +46
-12
lines changed Expand file tree Collapse file tree 11 files changed +46
-12
lines changed Original file line number Diff line number Diff line change 56
56
Click me
57
57
</ div >
58
58
</ section >
59
+
60
+ < h3 > MatRipple without options</ h3 >
61
+
62
+ < p >
63
+ < mat-card matRipple > Just a normal card.</ mat-card >
64
+ </ p >
65
+
66
+ < p >
67
+ < mat-toolbar matRipple > Just a normal toolbar</ mat-toolbar >
68
+ </ p >
69
+
70
+ < p >
71
+ < button matRipple > Just a normal button</ button >
72
+ </ p >
59
73
</ div >
Original file line number Diff line number Diff line change 12
12
font-size : 24px ;
13
13
height : 150px ;
14
14
line-height : 150px ;
15
- position : relative ;
16
15
text-align : center ;
17
16
transition : all 200ms linear ;
18
17
width : 200px ;
27
26
28
27
& .demo-ripple-rounded {
29
28
border-radius : 50% ;
30
- overflow : hidden ;
31
29
// z-index needed to make clipping to border-radius work correctly.
32
30
// http://stackoverflow.com/questions/20001515/
33
31
z-index : 1 ;
Original file line number Diff line number Diff line change @@ -92,7 +92,9 @@ $mat-button-toggle-border-radius: 2px !default;
92
92
}
93
93
}
94
94
95
- .mat-button-toggle-ripple {
95
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
96
+ // potentially overwrite the absolute position of the container.
97
+ .mat-button-toggle .mat-button-toggle-ripple {
96
98
@include mat-fill ;
97
99
98
100
// Disable pointer events for the ripple container, because the container will overlay the user
Original file line number Diff line number Diff line change 65
65
}
66
66
}
67
67
68
- // The ripple container should match the bounds of the entire button.
69
- .mat-button-ripple , .mat-button-focus-overlay {
68
+ // The ripple container and focus overlay should match the bounds of the entire button.
69
+ // Increase specificity for the ripple container because ripple styles are part of
70
+ // the `mat-core` mixin and can potentially overwrite the absolute position of the container.
71
+ .mat-button-ripple.mat-ripple ,
72
+ .mat-button-focus-overlay {
70
73
@include mat-fill ;
71
74
72
75
// Disable pointer events for the ripple container and focus overlay because the container
Original file line number Diff line number Diff line change @@ -431,7 +431,9 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
431
431
left : 50% ;
432
432
}
433
433
434
- .mat-checkbox-ripple {
434
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
435
+ // potentially overwrite the absolute position of the container.
436
+ .mat-checkbox .mat-checkbox-ripple {
435
437
position : absolute ;
436
438
left : calc (50% - #{$_mat-checkbox-ripple-radius } );
437
439
top : calc (50% - #{$_mat-checkbox-ripple-radius } );
Original file line number Diff line number Diff line change 57
57
text-overflow : ellipsis ;
58
58
}
59
59
60
- .mat-option-ripple {
60
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
61
+ // potentially overwrite the absolute position of the container.
62
+ .mat-option .mat-option-ripple {
61
63
@include mat-fill ;
62
64
63
65
// Disable pointer events for the ripple container because the container will overlay the
Original file line number Diff line number Diff line change 4
4
$mat-ripple-color-opacity : 0.1 ;
5
5
6
6
@mixin mat-ripple () {
7
+
7
8
// The host element of an mat-ripple directive should always have a position of "absolute" or
8
- // "relative" so that the ripple divs it creates inside itself are correctly positioned.
9
+ // "relative" so that the ripples inside are correctly positioned relatively to the container .
9
10
.mat-ripple {
10
11
overflow : hidden ;
11
12
13
+ // By default, every ripple container should have position: relative in favor of creating an
14
+ // easy API for developers using the MatRipple directive.
15
+ position : relative ;
16
+
12
17
// In high contrast mode the ripple is opaque, causing it to obstruct the content.
13
18
@include cdk-high-contrast {
14
19
display : none ;
Original file line number Diff line number Diff line change @@ -75,7 +75,9 @@ button.mat-menu-item {
75
75
width : 100% ;
76
76
}
77
77
78
- .mat-menu-ripple {
78
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
79
+ // potentially overwrite the absolute position of the container.
80
+ .mat-menu-item .mat-menu-ripple {
79
81
@include mat-fill ;
80
82
81
83
// Prevent any pointer events on the ripple container for a menu item. The ripple container is
Original file line number Diff line number Diff line change @@ -115,7 +115,9 @@ $mat-radio-ripple-radius: 25px;
115
115
cursor : default ;
116
116
}
117
117
118
- .mat-radio-ripple {
118
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
119
+ // potentially overwrite the absolute position of the container.
120
+ .mat-radio-button .mat-radio-ripple {
119
121
position : absolute ;
120
122
left : calc (50% - #{$mat-radio-ripple-radius } );
121
123
top : calc (50% - #{$mat-radio-ripple-radius } );
Original file line number Diff line number Diff line change @@ -172,7 +172,9 @@ $mat-slide-toggle-bar-track-width: $mat-slide-toggle-bar-width - $mat-slide-togg
172
172
}
173
173
174
174
// Ripple positioning for the slide-toggle. Moves the ripple container into the center of the thumb.
175
- .mat-slide-toggle-ripple {
175
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
176
+ // potentially overwrite the absolute position of the container.
177
+ .mat-slide-toggle .mat-slide-toggle-ripple {
176
178
position : absolute ;
177
179
top : calc (50% - #{$mat-slide-toggle-ripple-radius } );
178
180
left : calc (50% - #{$mat-slide-toggle-ripple-radius } );
Original file line number Diff line number Diff line change @@ -51,7 +51,9 @@ $mat-step-header-icon-size: 16px !default;
51
51
overflow : hidden ;
52
52
}
53
53
54
- .mat-step-header-ripple {
54
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
55
+ // potentially overwrite the absolute position of the container.
56
+ .mat-step-header .mat-step-header-ripple {
55
57
@include mat-fill ;
56
58
pointer-events : none ;
57
59
}
You can’t perform that action at this time.
0 commit comments