File tree 3 files changed +19
-1
lines changed
src/material-experimental/mdc-radio
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 16
16
));
17
17
18
18
// TODO(crisbeto): this should be included by MDC's `theme-styles`, but it isn't currently.
19
- @include mdc-radio-theme .focus-indicator-color ($color-palette );
19
+ & .mat-mdc-radio-checked {
20
+ --mat-mdc-radio-ripple-color : #{$color-palette } ;
21
+ }
20
22
}
21
23
22
24
@mixin color ($config-or-theme ) {
41
43
unselected- pressed- icon- color: $on-surface ,
42
44
));
43
45
46
+ --mat-mdc-radio-ripple-color : #{mdc-theme-color .prop-value (on-surface )} ;
47
+
44
48
& .mat-primary {
45
49
@include _color-palette ($primary );
46
50
}
Original file line number Diff line number Diff line change 3
3
@use ' @material/radio/radio-theme' as mdc-radio-theme ;
4
4
@use ' @material/form-field' as mdc-form-field ;
5
5
@use ' @material/touch-target' as mdc-touch-target ;
6
+ @use ' @material/ripple' as mdc-ripple ;
6
7
@use ' ../mdc-helpers/mdc-helpers' ;
7
8
@use ' ../../cdk/a11y' ;
8
9
@use ' ../../material/core/style/layout-common' ;
33
34
unselected- pressed- state- layer- color: null,
34
35
unselected- pressed- state- layer- opacity: null,
35
36
)));
37
+
38
+ // TODO(crisbeto): this should be included by MDC's `theme-styles`, but it isn't currently.
39
+ @include mdc-radio-theme .focus-indicator-color (
40
+ var (--mat-mdc-radio-ripple-color , transparent ));
41
+ }
42
+
43
+ // MDC's hover indication comes from their ripple which we don't use.
44
+ & :hover .mdc-radio__native-control :not ([disabled ]):not (:focus ) {
45
+ & ~ .mdc-radio__background ::before {
46
+ opacity : map .get (mdc-ripple .$dark-ink-opacities , hover );
47
+ transform : scale (1 );
48
+ }
36
49
}
37
50
}
38
51
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ export class MatRadioGroup extends _MatRadioGroupBase<MatRadioButton> {
90
90
'[class.mat-primary]' : 'color === "primary"' ,
91
91
'[class.mat-accent]' : 'color === "accent"' ,
92
92
'[class.mat-warn]' : 'color === "warn"' ,
93
+ '[class.mat-mdc-radio-checked]' : 'checked' ,
93
94
'[class._mat-animation-noopable]' : '_noopAnimations' ,
94
95
// Needs to be removed since it causes some a11y issues (see #21266).
95
96
'[attr.tabindex]' : 'null' ,
You can’t perform that action at this time.
0 commit comments