|
| 1 | +@use 'sass:map'; |
1 | 2 | @use '@material/radio/radio' as mdc-radio; |
2 | 3 | @use '@material/radio/radio-theme' as mdc-radio-theme; |
3 | 4 | @use '@material/form-field' as mdc-form-field; |
|
7 | 8 | @use '../../material/core/style/layout-common'; |
8 | 9 |
|
9 | 10 | @include mdc-helpers.disable-fallback-declarations { |
10 | | - @include mdc-radio.without-ripple($query: mdc-helpers.$mat-base-styles-without-animation-query); |
| 11 | + @include mdc-radio.static-styles($query: mdc-helpers.$mat-base-styles-query); |
11 | 12 | @include mdc-form-field.core-styles($query: mdc-helpers.$mat-base-styles-query); |
12 | 13 | } |
13 | 14 |
|
14 | 15 | .mat-mdc-radio-button { |
15 | | - &:not(._mat-animation-noopable) { |
16 | | - @include mdc-helpers.disable-fallback-declarations { |
17 | | - @include mdc-radio.without-ripple($query: animation); |
18 | | - } |
19 | | - } |
20 | | - |
21 | 16 | .mdc-radio { |
22 | 17 | // MDC theme styles also include structural styles so we have to include the theme at least |
23 | 18 | // once here. The values will be overwritten by our own theme file afterwards. |
24 | 19 | @include mdc-helpers.disable-fallback-declarations { |
25 | | - @include mdc-radio-theme.theme-styles(mdc-radio-theme.$light-theme); |
| 20 | + @include mdc-radio-theme.theme-styles(map.merge(mdc-radio-theme.$light-theme, ( |
| 21 | + // Exclude the styles we don't need. |
| 22 | + selected-focus-state-layer-color: null, |
| 23 | + selected-focus-state-layer-opacity: null, |
| 24 | + selected-hover-state-layer-color: null, |
| 25 | + selected-hover-state-layer-opacity: null, |
| 26 | + selected-pressed-state-layer-color: null, |
| 27 | + selected-pressed-state-layer-opacity: null, |
| 28 | + state-layer-size: null, |
| 29 | + unselected-focus-icon-color: null, |
| 30 | + unselected-focus-state-layer-color: null, |
| 31 | + unselected-focus-state-layer-opacity: null, |
| 32 | + unselected-hover-state-layer-color: null, |
| 33 | + unselected-hover-state-layer-opacity: null, |
| 34 | + unselected-pressed-state-layer-color: null, |
| 35 | + unselected-pressed-state-layer-opacity: null, |
| 36 | + ))); |
26 | 37 | } |
27 | 38 | } |
28 | 39 |
|
|
33 | 44 | pointer-events: none; |
34 | 45 | border-radius: 50%; |
35 | 46 |
|
36 | | - .mat-ripple-element:not(.mat-radio-persistent-ripple) { |
| 47 | + .mat-ripple-element { |
37 | 48 | opacity: mdc-radio-theme.$ripple-opacity; |
38 | 49 | } |
39 | 50 | } |
| 51 | + |
| 52 | + &._mat-animation-noopable { |
| 53 | + .mdc-radio__background::before, |
| 54 | + .mdc-radio__outer-circle, |
| 55 | + .mdc-radio__inner-circle { |
| 56 | + // Needs to be `!important`, because MDC's selectors are really specific. |
| 57 | + transition: none !important; |
| 58 | + } |
| 59 | + } |
40 | 60 | } |
41 | 61 |
|
42 | 62 | // Element used to provide a larger tap target for users on touch devices. |
|
0 commit comments