Skip to content

Commit d191329

Browse files
authored
fix(material-experimental/mdc-button): add base css class to all buttons (#18422)
1 parent 7b3ea26 commit d191329

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/material-experimental/mdc-button/button-base.ts

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ export const MAT_BUTTON_HOST = {
3535
// an unthemed version. If color is undefined, apply a CSS class that makes it easy to
3636
// select and style this "theme".
3737
'[class.mat-unthemed]': '!color',
38+
// Add a class that applies to all buttons. This makes it easier to target if somebody
39+
// wants to target all Material buttons.
40+
'[class.mat-mdc-button-base]': 'true',
3841
'class': 'mat-mdc-focus-indicator',
3942
};
4043

@@ -152,6 +155,9 @@ export const MAT_ANCHOR_HOST = {
152155
// select and style this "theme".
153156
'[class.mat-unthemed]': '!color',
154157
'class': 'mat-mdc-focus-indicator',
158+
// Add a class that applies to all buttons. This makes it easier to target if somebody
159+
// wants to target all Material buttons.
160+
'[class.mat-mdc-button-base]': 'true',
155161
};
156162

157163
/**

src/material/dialog/dialog.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ $mat-dialog-button-margin: 8px !default;
6161
justify-content: center;
6262
}
6363

64-
.mat-button-base + .mat-button-base {
64+
.mat-button-base + .mat-button-base,
65+
.mat-mdc-button-base + .mat-mdc-button-base {
6566
margin-left: $mat-dialog-button-margin;
6667

6768
[dir='rtl'] & {

src/material/expansion/expansion-panel.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
justify-content: flex-end;
7373
padding: 16px 8px 16px 24px;
7474

75-
button.mat-button-base {
75+
button.mat-button-base, button.mat-mdc-button-base {
7676
margin-left: 8px;
7777

7878
[dir='rtl'] & {

0 commit comments

Comments
 (0)