Skip to content

Commit dfd2f92

Browse files
committed
fix(material-experimental/mdc-snack-bar): use MDC-based button
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.
1 parent 71b7b15 commit dfd2f92

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/material-experimental/mdc-snack-bar/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ng_module(
2222
module_name = "@angular/material-experimental/mdc-snack-bar",
2323
deps = [
2424
"//src:dev_mode_types",
25+
"//src/material-experimental/mdc-button",
2526
"//src/material-experimental/mdc-core",
2627
"//src/material/snack-bar",
2728
"@npm//@angular/core",

src/material-experimental/mdc-snack-bar/_snack-bar-theme.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
@include mdc-snackbar-core-styles($query: $mat-theme-styles-query);
2929
}
3030

31+
// Usually this color is provided by the `mdc-snackbar-core-styles` mixin, but our styles
32+
// to handle unthemed buttons have a higher specificity so we have to re-provide it here.
33+
.mat-mdc-snack-bar-container .mat-mdc-snack-bar-action.mdc-snackbar__action {
34+
color: $mdc-snackbar-action-ink-color;
35+
}
36+
3137
$mdc-snackbar-fill-color: $orig-mdc-snackbar-fill-color !global;
3238
$mdc-snackbar-label-ink-color: $orig-mdc-snackbar-label-ink-color !global;
3339
$mdc-snackbar-dismiss-ink-color: $orig-mdc-snackbar-dismiss-ink-color !global;

src/material-experimental/mdc-snack-bar/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {OverlayModule} from '@angular/cdk/overlay';
1010
import {PortalModule} from '@angular/cdk/portal';
1111
import {CommonModule} from '@angular/common';
1212
import {NgModule} from '@angular/core';
13-
import {MatButtonModule} from '@angular/material/button';
13+
import {MatButtonModule} from '@angular/material-experimental/mdc-button';
1414
import {MatCommonModule} from '@angular/material-experimental/mdc-core';
1515

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

0 commit comments

Comments
 (0)