|
1 | | -@use 'sass:map'; |
2 | | -@use '../core/mdc-helpers/mdc-helpers'; |
3 | 1 | @use '@angular/cdk'; |
4 | 2 | @use '@material/circular-progress/circular-progress' as mdc-circular-progress; |
5 | 3 | @use '@material/circular-progress/circular-progress-theme' as mdc-circular-progress-theme; |
| 4 | +@use '@material/theme/custom-properties' as mdc-custom-properties; |
| 5 | +@use '../core/tokens/m2/mdc/progress-spinner' as m2-mdc-progress-spinner; |
6 | 6 |
|
| 7 | +// The slots for tokens that will be configured in the theme can be emitted with no fallback. |
| 8 | +@include mdc-custom-properties.configure($emit-fallback-values: false, $emit-fallback-vars: false) { |
| 9 | + $mdc-circular-progress-token-slots: m2-mdc-progress-spinner.get-token-slots(); |
7 | 10 |
|
8 | | -@include mdc-helpers.disable-mdc-fallback-declarations { |
9 | | - @include mdc-circular-progress.static-styles($query: mdc-helpers.$mdc-base-styles-query); |
10 | | -} |
11 | | - |
12 | | -.mat-mdc-progress-spinner { |
13 | | - @include mdc-helpers.disable-mdc-fallback-declarations { |
14 | | - @include mdc-circular-progress-theme.theme-styles(map.merge( |
15 | | - mdc-circular-progress-theme.$light-theme, |
16 | | - ( |
17 | | - active-indicator-color: transparent, |
| 11 | + // Add the MDC progress spinner static styles. |
| 12 | + @include mdc-circular-progress.static-styles(); |
18 | 13 |
|
19 | | - // We don't support the multi color variant so we exclude these variables. |
20 | | - four-color-active-indicator-four-color: null, |
21 | | - four-color-active-indicator-one-color: null, |
22 | | - four-color-active-indicator-three-color: null, |
23 | | - four-color-active-indicator-two-color: null, |
| 14 | + // Add the official slots for the MDC circular progress. |
| 15 | + @include mdc-circular-progress-theme.theme-styles($mdc-circular-progress-token-slots); |
24 | 16 |
|
25 | | - // We currently size the element ourselves so we can exclude these styles as well. |
26 | | - // TODO(crisbeto): look into reusing MDC's styles by binding to a CSS variable |
27 | | - // in our own template. |
28 | | - active-indicator-width: null, |
29 | | - size: null, |
30 | | - ) |
31 | | - )); |
| 17 | + // Add default values for tokens that aren't outputted by the theming API. |
| 18 | + .mat-mdc-progress-spinner { |
| 19 | + @include mdc-circular-progress-theme.theme(m2-mdc-progress-spinner.get-unthemable-tokens()); |
32 | 20 | } |
| 21 | +} |
33 | 22 |
|
| 23 | +.mat-mdc-progress-spinner { |
34 | 24 | // Explicitly set to `block` since the browser defaults custom elements to `inline`. |
35 | 25 | display: block; |
36 | 26 |
|
|
43 | 33 | line-height: 0; |
44 | 34 |
|
45 | 35 | &._mat-animation-noopable { |
46 | | - &, .mdc-circular-progress__determinate-circle { |
| 36 | + &, |
| 37 | + .mdc-circular-progress__determinate-circle { |
47 | 38 | // The spinner itself has a transition on `opacity`. |
48 | 39 | transition: none; |
49 | 40 | } |
|
0 commit comments