Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(material-experimental/radio): redefine theme variables #18907

Merged
merged 1 commit into from Mar 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/material-experimental/mdc-radio/_radio-theme.scss
@@ -1,14 +1,19 @@
@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 {
Expand All @@ -29,6 +34,8 @@

// 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) {
Expand Down