From 5c6091880d06a59265e0a47deb3e6d32e057c0d1 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Fri, 8 Jan 2021 15:56:02 +0200 Subject: [PATCH] fix(material/card): not clearing margin on last button in end alignment 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. --- src/material/card/card.scss | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/material/card/card.scss b/src/material/card/card.scss index d6d05fb80be7..318f829dafd6 100644 --- a/src/material/card/card.scss +++ b/src/material/card/card.scss @@ -203,10 +203,23 @@ $mat-card-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; }