Skip to content

Commit

Permalink
fix(material-experimental/mdc-snack-bar): use MDC-based button
Browse files Browse the repository at this point in the history
Switches the MDC-based snack bar to use the MDC-based button. In general we should
be using the MDC versions of components together, when possible.
  • Loading branch information
crisbeto committed Dec 26, 2020
1 parent 71b7b15 commit dfd2f92
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/material-experimental/mdc-snack-bar/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ng_module(
module_name = "@angular/material-experimental/mdc-snack-bar",
deps = [
"//src:dev_mode_types",
"//src/material-experimental/mdc-button",
"//src/material-experimental/mdc-core",
"//src/material/snack-bar",
"@npm//@angular/core",
Expand Down
6 changes: 6 additions & 0 deletions src/material-experimental/mdc-snack-bar/_snack-bar-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
@include mdc-snackbar-core-styles($query: $mat-theme-styles-query);
}

// Usually this color is provided by the `mdc-snackbar-core-styles` mixin, but our styles
// to handle unthemed buttons have a higher specificity so we have to re-provide it here.
.mat-mdc-snack-bar-container .mat-mdc-snack-bar-action.mdc-snackbar__action {
color: $mdc-snackbar-action-ink-color;
}

$mdc-snackbar-fill-color: $orig-mdc-snackbar-fill-color !global;
$mdc-snackbar-label-ink-color: $orig-mdc-snackbar-label-ink-color !global;
$mdc-snackbar-dismiss-ink-color: $orig-mdc-snackbar-dismiss-ink-color !global;
Expand Down
2 changes: 1 addition & 1 deletion src/material-experimental/mdc-snack-bar/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {OverlayModule} from '@angular/cdk/overlay';
import {PortalModule} from '@angular/cdk/portal';
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {MatButtonModule} from '@angular/material/button';
import {MatButtonModule} from '@angular/material-experimental/mdc-button';
import {MatCommonModule} from '@angular/material-experimental/mdc-core';

import {MatSimpleSnackBar} from './simple-snack-bar';
Expand Down

0 comments on commit dfd2f92

Please sign in to comment.