Skip to content

Commit 4e6e42e

Browse files
devversiontinayuangao
authored andcommitted
fix(list): properly align contents in subheader (#6221)
* fix(list): properly align contents in subheader * The line-height of the subheaders is currently based on the typography level. This is problematic because the subheader is set to a specific height and can't grow/shrink accordingly. Fixes #6214 * Address feedback
1 parent 0795432 commit 4e6e42e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/lib/list/_list-theme.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
}
4747

4848
.mat-subheader {
49-
@include mat-typography-level-to-styles($config, body-2);
49+
font-family: mat-font-family($config, body-2);
50+
font-size: mat-font-size($config, body-2);
51+
font-weight: mat-font-weight($config, body-2);
5052
}
5153
}
5254

@@ -58,7 +60,9 @@
5860
}
5961

6062
.mat-subheader {
61-
font: mat-font-weight($config, body-2) mat-font-size($config, caption) $font-family;
63+
font-family: $font-family;
64+
font-size: mat-font-size($config, caption);
65+
font-weight: mat-font-weight($config, body-2);
6266
}
6367
}
6468
}

src/lib/list/list.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ $mat-dense-list-icon-size: 20px;
121121
// This mixin adjusts the heights and padding based on whether the list is in dense mode.
122122
@mixin mat-subheader-spacing($top-padding, $base-height) {
123123
height: $base-height;
124+
line-height: $base-height - $mat-list-side-padding * 2;
124125

125126
&:first-child {
126127
margin-top: -$top-padding;

0 commit comments

Comments
 (0)