File tree Expand file tree Collapse file tree 10 files changed +32
-13
lines changed
material-examples/ripple-overview Expand file tree Collapse file tree 10 files changed +32
-13
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,9 @@ $mat-button-toggle-border-radius: 2px !default;
93
93
}
94
94
}
95
95
96
- .mat-button-toggle-ripple {
96
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
97
+ // potentially overwrite the absolute position of the container.
98
+ .mat-button-toggle .mat-button-toggle-ripple {
97
99
@include mat-fill ;
98
100
99
101
// Disable pointer events for the ripple container, because the container will overlay the user
Original file line number Diff line number Diff line change 75
75
}
76
76
}
77
77
78
- // The ripple container should match the bounds of the entire button.
79
- .mat-button-ripple , .mat-button-focus-overlay {
78
+ // The ripple container and focus overlay should match the bounds of the entire button.
79
+ // Increase specificity for the ripple container because ripple styles are part of
80
+ // the `mat-core` mixin and can potentially overwrite the absolute position of the container.
81
+ .mat-button-ripple.mat-ripple ,
82
+ .mat-button-focus-overlay {
80
83
@include mat-fill ;
81
84
82
85
// 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 58
58
text-overflow : ellipsis ;
59
59
}
60
60
61
- .mat-option-ripple {
61
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
62
+ // potentially overwrite the absolute position of the container.
63
+ .mat-option .mat-option-ripple {
62
64
@include mat-fill ;
63
65
64
66
// 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 ;
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 ;
11
16
}
12
17
13
18
.mat-ripple.mat-ripple-unbounded {
Original file line number Diff line number Diff line change @@ -83,7 +83,9 @@ button.mat-menu-item {
83
83
width : 100% ;
84
84
}
85
85
86
- .mat-menu-ripple {
86
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
87
+ // potentially overwrite the absolute position of the container.
88
+ .mat-menu-item .mat-menu-ripple {
87
89
@include mat-fill ;
88
90
89
91
// 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 @@ -179,7 +179,9 @@ $mat-slide-toggle-bar-track-width: $mat-slide-toggle-bar-width - $mat-slide-togg
179
179
}
180
180
181
181
// Ripple positioning for the slide-toggle. Moves the ripple container into the center of the thumb.
182
- .mat-slide-toggle-ripple {
182
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
183
+ // potentially overwrite the absolute position of the container.
184
+ .mat-slide-toggle .mat-slide-toggle-ripple {
183
185
position : absolute ;
184
186
top : calc (50% - #{$mat-slide-toggle-ripple-radius } );
185
187
left : calc (50% - #{$mat-slide-toggle-ripple-radius } );
Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ $mat-step-header-icon-size: 16px !default;
52
52
overflow : hidden ;
53
53
}
54
54
55
- .mat-step-header-ripple {
55
+ // Increase specificity because ripple styles are part of the `mat-core` mixin and can
56
+ // potentially overwrite the absolute position of the container.
57
+ .mat-step-header .mat-step-header-ripple {
56
58
@include mat-fill ;
57
59
pointer-events : none ;
58
60
}
Original file line number Diff line number Diff line change 1
1
.example-ripple-container {
2
- /** Necessary until: https://github.com/angular/material2/pull/11913*/
3
- position : relative;
4
-
5
2
cursor : pointer;
6
3
text-align : center;
7
4
You can’t perform that action at this time.
0 commit comments