Skip to content

Commit 4d45db7

Browse files
crisbetoannieyw
authored andcommitted
fix(material/card): not clearing margin on last button in end alignment (#20040)
We have some styles that clear the margin from the first button, but we didn't apply the same to the last button if the card actions are aligned towards the end. Fixes #20024. (cherry picked from commit 619d591)
1 parent 90f7a56 commit 4d45db7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/material/card/card.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,23 @@ $mat-card-header-size: 40px !default;
203203
// actions panel should always be 8px from sides,
204204
// so the first button in the actions panel can't add its own margins
205205
.mat-card-actions {
206+
&:not(.mat-card-actions-align-end) {
207+
.mat-button,
208+
.mat-raised-button,
209+
.mat-stroked-button {
210+
&:first-child {
211+
margin-left: 0;
212+
margin-right: 0;
213+
}
214+
}
215+
}
216+
}
217+
218+
.mat-card-actions-align-end {
206219
.mat-button,
207220
.mat-raised-button,
208221
.mat-stroked-button {
209-
&:first-child {
222+
&:last-child {
210223
margin-left: 0;
211224
margin-right: 0;
212225
}

0 commit comments

Comments
 (0)