|
3 | 3 | @import '@material/fab/mixins'; |
4 | 4 | @import '@material/ripple/mixins'; |
5 | 5 | @import '@material/icon-button/mixins'; |
| 6 | +@import '../../material/core/ripple/ripple'; |
6 | 7 | @import '../mdc-helpers/mdc-helpers'; |
7 | 8 |
|
8 | 9 | // Applies the disabled theme color to the text color. |
|
23 | 24 | } |
24 | 25 | } |
25 | 26 |
|
| 27 | +// The MDC button's ripple ink color is based on the theme color, not on the foreground base |
| 28 | +// which is what the ripple mixin uses. This creates a new theme that sets the color to the |
| 29 | +// foreground base to appropriately color the ink. |
| 30 | +@mixin _mat-button-ripple-ink-color($mdcColor) { |
| 31 | + @include mat-ripple-theme(( |
| 32 | + foreground: ( |
| 33 | + base: mdc-theme-prop-value($mdcColor) |
| 34 | + ), |
| 35 | + )); |
| 36 | +} |
| 37 | + |
26 | 38 | // Applies the disabled theme background color for raised buttons. Value is taken from |
27 | 39 | // mixin `mdc-button--filled`. |
28 | 40 | // TODO(andrewseguin): Discuss with the MDC team about providing a variable for the 0.12 value |
|
48 | 60 | &.mat-primary { |
49 | 61 | @include mdc-button-ink-color(primary, $query: $mat-theme-styles-query); |
50 | 62 | @include mdc-states-base-color(primary, $query: $mat-theme-styles-query); |
| 63 | + @include _mat-button-ripple-ink-color(primary); |
51 | 64 | } |
52 | 65 |
|
53 | 66 | &.mat-accent { |
54 | 67 | @include mdc-button-ink-color(secondary, $query: $mat-theme-styles-query); |
55 | 68 | @include mdc-states-base-color(secondary, $query: $mat-theme-styles-query); |
| 69 | + @include _mat-button-ripple-ink-color(secondary); |
56 | 70 | } |
57 | 71 |
|
58 | 72 | &.mat-warn { |
59 | 73 | @include mdc-button-ink-color(error, $query: $mat-theme-styles-query); |
60 | 74 | @include mdc-states-base-color(error, $query: $mat-theme-styles-query); |
| 75 | + @include _mat-button-ripple-ink-color(error); |
61 | 76 | } |
62 | 77 | } |
63 | 78 |
|
|
74 | 89 | @include mdc-button-container-fill-color(primary, $query: $mat-theme-styles-query); |
75 | 90 | @include mdc-button-ink-color(on-primary, $query: $mat-theme-styles-query); |
76 | 91 | @include mdc-states-base-color(on-primary, $query: $mat-theme-styles-query); |
| 92 | + @include _mat-button-ripple-ink-color(on-primary); |
77 | 93 | } |
78 | 94 |
|
79 | 95 | &.mat-accent { |
80 | 96 | @include mdc-button-container-fill-color(secondary, $query: $mat-theme-styles-query); |
81 | 97 | @include mdc-button-ink-color(on-secondary, $query: $mat-theme-styles-query); |
82 | 98 | @include mdc-states-base-color(on-secondary, $query: $mat-theme-styles-query); |
| 99 | + @include _mat-button-ripple-ink-color(on-secondary); |
83 | 100 | } |
84 | 101 |
|
85 | 102 | &.mat-warn { |
86 | 103 | @include mdc-button-container-fill-color(error, $query: $mat-theme-styles-query); |
87 | 104 | @include mdc-button-ink-color(on-error, $query: $mat-theme-styles-query); |
88 | 105 | @include mdc-states-base-color(on-error, $query: $mat-theme-styles-query); |
| 106 | + @include _mat-button-ripple-ink-color(on-error); |
89 | 107 | } |
90 | 108 |
|
91 | 109 | @include _mat-button-apply-disabled-style() { |
|
153 | 171 | @include mdc-states-base-color(on-primary, $query: $mat-theme-styles-query); |
154 | 172 | @include mdc-fab-container-color(primary, $query: $mat-theme-styles-query); |
155 | 173 | @include mdc-fab-ink-color(on-primary, $query: $mat-theme-styles-query); |
| 174 | + @include _mat-button-ripple-ink-color(on-primary); |
156 | 175 | } |
157 | 176 |
|
158 | 177 | &.mat-accent { |
159 | 178 | @include mdc-states-base-color(on-secondary, $query: $mat-theme-styles-query); |
160 | 179 | @include mdc-fab-container-color(secondary, $query: $mat-theme-styles-query); |
161 | 180 | @include mdc-fab-ink-color(on-secondary, $query: $mat-theme-styles-query); |
| 181 | + @include _mat-button-ripple-ink-color(on-secondary); |
162 | 182 | } |
163 | 183 |
|
164 | 184 | &.mat-warn { |
165 | 185 | @include mdc-states-base-color(on-error, $query: $mat-theme-styles-query); |
166 | 186 | @include mdc-fab-container-color(error, $query: $mat-theme-styles-query); |
167 | 187 | @include mdc-fab-ink-color(on-error, $query: $mat-theme-styles-query); |
| 188 | + @include _mat-button-ripple-ink-color(on-error); |
168 | 189 | } |
169 | 190 |
|
170 | 191 | @include _mat-button-apply-disabled-style() { |
|
197 | 218 | &.mat-primary { |
198 | 219 | @include mdc-states-base-color(primary, $query: $mat-theme-styles-query); |
199 | 220 | @include mdc-icon-button-ink-color(primary, $query: $mat-theme-styles-query); |
| 221 | + @include _mat-button-ripple-ink-color(primary); |
200 | 222 | } |
201 | 223 |
|
202 | 224 | &.mat-accent { |
203 | 225 | @include mdc-states-base-color(secondary, $query: $mat-theme-styles-query); |
204 | 226 | @include mdc-icon-button-ink-color(secondary, $query: $mat-theme-styles-query); |
| 227 | + @include _mat-button-ripple-ink-color(secondary); |
205 | 228 | } |
206 | 229 |
|
207 | 230 | &.mat-warn { |
208 | 231 | @include mdc-states-base-color(error, $query: $mat-theme-styles-query); |
209 | 232 | @include mdc-icon-button-ink-color(error, $query: $mat-theme-styles-query); |
| 233 | + @include _mat-button-ripple-ink-color(error); |
210 | 234 | } |
211 | 235 |
|
212 | 236 | @include _mat-button-apply-disabled-style() { |
|
0 commit comments