|
1 |
| -@use 'sass:math'; |
2 | 1 | @use '../core/mdc-helpers/mdc-helpers';
|
3 | 2 | @use '@material/card' as mdc-card;
|
4 | 3 |
|
@@ -44,13 +43,6 @@ $mat-card-default-padding: 16px !default;
|
44 | 43 | // Apply default padding for the header region. Omit any bottom padding because we assume
|
45 | 44 | // this region will be followed by another region that includes top padding.
|
46 | 45 | padding: $mat-card-default-padding $mat-card-default-padding 0;
|
47 |
| - |
48 |
| - // When a subtitle is inside of a header, we want to move it up slightly to reduce the space with |
49 |
| - // the title, and add a margin bottom to create space underneath the header. |
50 |
| - .mat-mdc-card-subtitle { |
51 |
| - margin-top: -(math.div($mat-card-default-padding, 2)); |
52 |
| - margin-bottom: $mat-card-default-padding; |
53 |
| - } |
54 | 46 | }
|
55 | 47 |
|
56 | 48 | // Primary card content. MDC does not have a pre-made section for primary content.
|
@@ -93,10 +85,20 @@ $mat-card-default-padding: 16px !default;
|
93 | 85 | width: $mat-card-header-size;
|
94 | 86 | border-radius: 50%;
|
95 | 87 | flex-shrink: 0;
|
| 88 | + margin-bottom: $mat-card-default-padding; |
96 | 89 |
|
97 | 90 | // Makes `<img>` tags behave like `background-size: cover`. Not supported
|
98 | 91 | // in IE, but we're using it as a progressive enhancement.
|
99 | 92 | object-fit: cover;
|
| 93 | + |
| 94 | + // When a title and subtitle are used alongside an avatar, |
| 95 | + // reduce the spacing between them to better align with the avatar. |
| 96 | + & ~ .mat-mdc-card-header-text { |
| 97 | + .mat-mdc-card-subtitle, |
| 98 | + .mat-mdc-card-title { |
| 99 | + line-height: normal; |
| 100 | + } |
| 101 | + } |
100 | 102 | }
|
101 | 103 |
|
102 | 104 | // Specifically sized small image, specific to Angular Material.
|
|
0 commit comments