forked from angular/components
/
_radio-theme.scss
45 lines (38 loc) · 1.76 KB
/
_radio-theme.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@import '../mdc-helpers/mdc-helpers';
@import '@material/radio/mixins';
@import '@material/radio/variables';
@import '@material/theme/functions.import';
@mixin mat-mdc-radio-theme($theme) {
// Save original values of MDC global variables. We need to save these so we can restore the
// variables to their original values and prevent unintended side effects from using this mixin.
$orig-mdc-radio-baseline-theme-color: $mdc-radio-baseline-theme-color;
$orig-mdc-radio-unchecked-color: $mdc-radio-unchecked-color;
$orig-mdc-radio-disabled-circle-color: $mdc-radio-disabled-circle-color;
@include mat-using-mdc-theme($theme) {
$mdc-radio-baseline-theme-color: primary !global;
$mdc-radio-unchecked-color: rgba(mdc-theme-prop-value(on-surface), 0.54) !global;
$mdc-radio-disabled-circle-color: rgba(mdc-theme-prop-value(on-surface), 0.38) !global;
.mat-mdc-radio-button {
&.mat-primary {
@include mdc-radio-without-ripple($query: $mat-theme-styles-query);
}
&.mat-accent {
$mdc-radio-baseline-theme-color: secondary !global;
@include mdc-radio-without-ripple($query: $mat-theme-styles-query);
}
&.mat-warn {
$mdc-radio-baseline-theme-color: error !global;
@include mdc-radio-without-ripple($query: $mat-theme-styles-query);
}
}
}
// Restore original values of MDC global variables.
$mdc-radio-baseline-theme-color: $orig-mdc-radio-baseline-theme-color !global;
$mdc-radio-unchecked-color: $orig-mdc-radio-unchecked-color !global;
$mdc-radio-disabled-circle-color: $orig-mdc-radio-disabled-circle-color !global;
}
@mixin mat-mdc-radio-typography($config) {
@include mat-using-mdc-typography($config) {
@include mdc-radio-without-ripple($query: $mat-typography-styles-query);
}
}