Skip to content

Commit

Permalink
fix(material/card): not clearing margin on last button in end alignme…
Browse files Browse the repository at this point in the history
…nt (#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.
  • Loading branch information
crisbeto committed Mar 7, 2021
1 parent ca7d379 commit 619d591
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/material/card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,23 @@ $header-size: 40px !default;
// actions panel should always be 8px from sides,
// so the first button in the actions panel can't add its own margins
.mat-card-actions {
&:not(.mat-card-actions-align-end) {
.mat-button,
.mat-raised-button,
.mat-stroked-button {
&:first-child {
margin-left: 0;
margin-right: 0;
}
}
}
}

.mat-card-actions-align-end {
.mat-button,
.mat-raised-button,
.mat-stroked-button {
&:first-child {
&:last-child {
margin-left: 0;
margin-right: 0;
}
Expand Down

0 comments on commit 619d591

Please sign in to comment.