|
11 | 11 | mdc-theme-ink-color-for-fill_(disabled, $mdc-theme-background));
|
12 | 12 | }
|
13 | 13 |
|
| 14 | +// Wraps the content style in a selector for the disabled state. |
| 15 | +// MDC adds theme color by using :not(:disabled), so just using [disabled] once will not |
| 16 | +// override this, neither will it apply to anchor tags. This needs to override the |
| 17 | +// previously set theme color, so it must be ordered after the theme styles. |
| 18 | +@mixin _mat-button-apply-disabled-style() { |
| 19 | + &[disabled][disabled] { |
| 20 | + @content; |
| 21 | + } |
| 22 | +} |
| 23 | + |
14 | 24 | // Applies the disabled theme background color for raised buttons. Value is taken from
|
15 | 25 | // mixin `mdc-button--filled`
|
16 | 26 | @mixin _mat-button-disabled-background() {
|
|
54 | 64 | @include mdc-states-base-color(on-error, $query: $mat-theme-styles-query);
|
55 | 65 | }
|
56 | 66 |
|
57 |
| - &[disabled][disabled] { |
| 67 | + @include _mat-button-apply-disabled-style() { |
58 | 68 | @include _mat-button-disabled-background();
|
59 | 69 | }
|
60 | 70 | }
|
|
68 | 78 | @include mdc-button-outline-color(error, $query: $mat-theme-styles-query);
|
69 | 79 | }
|
70 | 80 |
|
71 |
| - &[disabled][disabled] { |
| 81 | + @include _mat-button-apply-disabled-style() { |
72 | 82 | @include mdc-theme-prop(border-color,
|
73 | 83 | mdc-theme-ink-color-for-fill_(disabled, $mdc-theme-background));
|
74 | 84 | }
|
75 | 85 | }
|
76 | 86 |
|
77 | 87 | .mat-mdc-raised-button {
|
78 |
| - &[disabled][disabled] { |
| 88 | + @include _mat-button-apply-disabled-style() { |
79 | 89 | @include mdc-elevation(0, $query: $mat-theme-styles-query);
|
80 | 90 | }
|
81 | 91 | }
|
82 | 92 |
|
83 |
| - // MDC adds theme color by using :not(:disabled), so just using [disabled] once will not |
84 |
| - // override this and also will not apply to anchor tags. This needs to override the |
85 |
| - // previously set theme color, so it must be ordered after the theme styles. |
86 | 93 | .mat-mdc-button, .mat-mdc-raised-button, .mat-mdc-unelevated-button, .mat-mdc-outlined-button {
|
87 |
| - &[disabled][disabled] { |
| 94 | + @include _mat-button-apply-disabled-style() { |
88 | 95 | @include _mat-button-disabled-color();
|
89 | 96 | }
|
90 | 97 | }
|
|
117 | 124 | @include mdc-fab-ink-color(on-error, $query: $mat-theme-styles-query);
|
118 | 125 | }
|
119 | 126 |
|
120 |
| - &[disabled][disabled] { |
| 127 | + @include _mat-button-apply-disabled-style() { |
121 | 128 | @include _mat-button-disabled-color();
|
122 | 129 | @include _mat-button-disabled-background();
|
123 | 130 | @include mdc-elevation(0, $query: $mat-theme-styles-query);
|
|
151 | 158 | @include mdc-icon-button-ink-color(error, $query: $mat-theme-styles-query);
|
152 | 159 | }
|
153 | 160 |
|
154 |
| - &[disabled][disabled] { |
| 161 | + @include _mat-button-apply-disabled-style() { |
155 | 162 | @include _mat-button-disabled-color();
|
156 | 163 | }
|
157 | 164 | }
|
|
0 commit comments