Skip to content

Commit

Permalink
fix(material-experimental/slide-toggle): redefine more variables (#18908
Browse files Browse the repository at this point in the history
)
  • Loading branch information
andrewseguin committed Mar 25, 2020
1 parent 16e2cf0 commit 1cca459
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -13,9 +13,17 @@
// 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-switch-baseline-theme-color: $mdc-switch-baseline-theme-color;
$orig-mdc-switch-toggled-off-thumb-color: $mdc-switch-toggled-off-thumb-color;
$orig-mdc-switch-toggled-off-track-color: $mdc-switch-toggled-off-track-color;
$orig-mdc-switch-disabled-thumb-color: $mdc-switch-disabled-thumb-color;
$orig-mdc-switch-disabled-track-color: $mdc-switch-disabled-track-color;

@include mat-using-mdc-theme($theme) {
$mdc-switch-baseline-theme-color: primary !global;
$mdc-switch-toggled-off-thumb-color: mdc-theme-prop-value(surface) !global;
$mdc-switch-toggled-off-track-color: mdc-theme-prop-value(on-surface) !global;
$mdc-switch-disabled-thumb-color: mdc-theme-prop-value(surface) !global;
$mdc-switch-disabled-track-color: mdc-theme-prop-value(on-surface) !global;

@include mdc-form-field-core-styles($query: $mat-theme-styles-query);

Expand Down Expand Up @@ -63,6 +71,10 @@

// Restore original values of MDC global variables.
$mdc-switch-baseline-theme-color: $orig-mdc-switch-baseline-theme-color !global;
$mdc-switch-toggled-off-thumb-color: $orig-mdc-switch-toggled-off-thumb-color !global;
$mdc-switch-toggled-off-track-color: $orig-mdc-switch-toggled-off-track-color !global;
$mdc-switch-disabled-thumb-color: $orig-mdc-switch-disabled-thumb-color !global;
$mdc-switch-disabled-track-color: $orig-mdc-switch-disabled-track-color !global;
}

@mixin mat-mdc-slide-toggle-typography($config) {
Expand Down

0 comments on commit 1cca459

Please sign in to comment.