Skip to content

Commit 9500e75

Browse files
devversionandrewseguin
authored andcommitted
feat(material-experimental/mdc-button): support density scaling
Note: mdc-icon-button seems to include the default density styles in their `mdc-icon-button-without-ripple` mixin. This means that we duplicate density styles by default. We need to figure out what to do in those cases. It seems like we need feature targeting for this.
1 parent 55373fb commit 9500e75

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/material-experimental/mdc-button/_button-theme.scss

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,14 @@ $mat-button-state-target: '.mdc-button__ripple';
170170
}
171171
}
172172

173-
@mixin mat-mdc-button-density($density-scale) {}
173+
@mixin mat-mdc-button-density($density-scale) {
174+
.mat-mdc-button,
175+
.mat-mdc-raised-button,
176+
.mat-mdc-unelevated-button,
177+
.mat-mdc-outlined-button {
178+
@include mdc-button-density($density-scale);
179+
}
180+
}
174181

175182
@mixin mat-mdc-button-theme($theme) {
176183
$color: mat-get-color-config($theme);
@@ -311,7 +318,11 @@ $mat-button-state-target: '.mdc-button__ripple';
311318
}
312319
}
313320

314-
@mixin mat-mdc-icon-button-density($density-scale) {}
321+
@mixin mat-mdc-icon-button-density($density-scale) {
322+
.mat-mdc-icon-button {
323+
@include mdc-icon-button-density($density-scale);
324+
}
325+
}
315326

316327
@mixin mat-mdc-icon-button-theme($theme) {
317328
$color: mat-get-color-config($theme);

src/material-experimental/mdc-button/button.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
@include mdc-button-without-ripple($query: $mat-base-styles-query);
99

1010
.mat-mdc-button, .mat-mdc-unelevated-button, .mat-mdc-raised-button, .mat-mdc-outlined-button {
11-
@include mdc-button-density(0, $mat-base-styles-query);
1211
@include _mat-button-interactive();
1312
@include _mat-button-disabled();
1413
}

0 commit comments

Comments
 (0)