|
99 | 99 | } |
100 | 100 |
|
101 | 101 | @mixin color($theme) { |
102 | | - .mat-mdc-button { |
| 102 | + @include sass-utils.current-selector-or-root() { |
103 | 103 | @include _text-button-variant($theme, null); |
| 104 | + @include _filled-button-variant($theme, null); |
| 105 | + @include _protected-button-variant($theme, null); |
| 106 | + @include _outlined-button-variant($theme, null); |
| 107 | + } |
104 | 108 |
|
| 109 | + .mat-mdc-button { |
105 | 110 | &.mat-primary { |
106 | 111 | @include _text-button-variant($theme, primary); |
107 | 112 | } |
|
116 | 121 | } |
117 | 122 |
|
118 | 123 | .mat-mdc-unelevated-button { |
119 | | - @include _filled-button-variant($theme, null); |
120 | | - |
121 | 124 | &.mat-primary { |
122 | 125 | @include _filled-button-variant($theme, primary); |
123 | 126 | } |
|
132 | 135 | } |
133 | 136 |
|
134 | 137 | .mat-mdc-raised-button { |
135 | | - @include _protected-button-variant($theme, null); |
136 | | - |
137 | 138 | &.mat-primary { |
138 | 139 | @include _protected-button-variant($theme, primary); |
139 | 140 | } |
|
161 | 162 | } |
162 | 163 |
|
163 | 164 | .mat-mdc-outlined-button { |
164 | | - @include _outlined-button-variant($theme, null); |
165 | | - |
166 | 165 | &.mat-primary { |
167 | 166 | @include _outlined-button-variant($theme, primary); |
168 | 167 | } |
|
178 | 177 | } |
179 | 178 |
|
180 | 179 | @mixin typography($theme) { |
181 | | - @include sass-utils.current-selector-or-root() { |
182 | | - $text-typography-tokens: tokens-mdc-text-button.get-typography-tokens($theme); |
183 | | - $filled-typography-tokens: tokens-mdc-filled-button.get-typography-tokens($theme); |
184 | | - $outlined-typography-tokens: tokens-mdc-outlined-button.get-typography-tokens($theme); |
185 | | - $protected-typography-tokens: tokens-mdc-protected-button.get-typography-tokens($theme); |
| 180 | + $text-typography-tokens: tokens-mdc-text-button.get-typography-tokens($theme); |
| 181 | + $filled-typography-tokens: tokens-mdc-filled-button.get-typography-tokens($theme); |
| 182 | + $outlined-typography-tokens: tokens-mdc-outlined-button.get-typography-tokens($theme); |
| 183 | + $protected-typography-tokens: tokens-mdc-protected-button.get-typography-tokens($theme); |
186 | 184 |
|
| 185 | + @include sass-utils.current-selector-or-root() { |
187 | 186 | @include mdc-button-text-theme.theme($text-typography-tokens); |
188 | 187 | @include mdc-button-filled-theme.theme($filled-typography-tokens); |
189 | 188 | @include mdc-button-outlined-theme.theme($outlined-typography-tokens); |
|
193 | 192 |
|
194 | 193 | @mixin density($theme) { |
195 | 194 | $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3); |
| 195 | + $text-density-tokens: tokens-mdc-text-button.get-density-tokens($theme); |
| 196 | + $filled-density-tokens: tokens-mdc-filled-button.get-density-tokens($theme); |
| 197 | + $outlined-density-tokens: tokens-mdc-outlined-button.get-density-tokens($theme); |
| 198 | + $protected-density-tokens: tokens-mdc-protected-button.get-density-tokens($theme); |
196 | 199 |
|
197 | | - .mat-mdc-button { |
198 | | - $density-tokens: tokens-mdc-text-button.get-density-tokens($theme); |
199 | | - @include mdc-button-text-theme.theme($density-tokens); |
200 | | - @include button-base.mat-private-button-touch-target-density($density-scale); |
201 | | - } |
202 | | - |
203 | | - .mat-mdc-raised-button { |
204 | | - $density-tokens: tokens-mdc-protected-button.get-density-tokens($theme); |
205 | | - @include mdc-button-protected-theme.theme($density-tokens); |
206 | | - @include button-base.mat-private-button-touch-target-density($density-scale); |
207 | | - } |
208 | | - |
209 | | - .mat-mdc-unelevated-button { |
210 | | - $density-tokens: tokens-mdc-filled-button.get-density-tokens($theme); |
211 | | - @include mdc-button-filled-theme.theme($density-tokens); |
212 | | - @include button-base.mat-private-button-touch-target-density($density-scale); |
| 200 | + @include sass-utils.current-selector-or-root() { |
| 201 | + @include mdc-button-text-theme.theme($text-density-tokens); |
| 202 | + @include mdc-button-filled-theme.theme($filled-density-tokens); |
| 203 | + @include mdc-button-outlined-theme.theme($outlined-density-tokens); |
| 204 | + @include mdc-button-protected-theme.theme($protected-density-tokens); |
213 | 205 | } |
214 | 206 |
|
| 207 | + .mat-mdc-button, |
| 208 | + .mat-mdc-raised-button, |
| 209 | + .mat-mdc-unelevated-button, |
215 | 210 | .mat-mdc-outlined-button { |
216 | | - $density-tokens: tokens-mdc-outlined-button.get-density-tokens($theme); |
217 | | - @include mdc-button-outlined-theme.theme($density-tokens); |
| 211 | + // TODO: tokenize the touch target visibility. |
218 | 212 | @include button-base.mat-private-button-touch-target-density($density-scale); |
219 | 213 | } |
220 | 214 | } |
|
0 commit comments