Skip to content

Commit 265ecba

Browse files
fix(list): ensure sass mixin works if leading is provided in px
This switches the subheader margin calculation from static to dynamic so that it will work if the $mdc-list-subheader-leading is provided in px instead of rem. Angular Material's current typography settings specify it in px. We do plan to move away from that and use rem like MDC, but this fix will make it work in the mean time. PiperOrigin-RevId: 297181874
1 parent 7ec9697 commit 265ecba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/mdc-list/_mixins.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@
292292
.mdc-list-group__subheader {
293293
$mdc-list-subheader-virtual-height: 3rem;
294294
$mdc-list-subheader-leading: map.get(map.get(typography-variables.$styles, body1), line-height);
295-
$mdc-list-subheader-margin: ($mdc-list-subheader-virtual-height - $mdc-list-subheader-leading) / 2;
295+
$mdc-list-subheader-margin: calc((#{$mdc-list-subheader-virtual-height} - #{$mdc-list-subheader-leading}) / 2);
296296

297297
@include typography-mixins.typography(subtitle1, $query);
298298

0 commit comments

Comments
 (0)