From 110c54cab6616712fc8b8f91cff667af5f1799f8 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 2 Aug 2017 14:14:52 +0200 Subject: [PATCH 1/2] 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 --- src/lib/list/_list-theme.scss | 3 ++- src/lib/list/list.scss | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/list/_list-theme.scss b/src/lib/list/_list-theme.scss index 2a064b4a9bdc..9bb1ad9cc0db 100644 --- a/src/lib/list/_list-theme.scss +++ b/src/lib/list/_list-theme.scss @@ -46,7 +46,8 @@ } .mat-subheader { - @include mat-typography-level-to-styles($config, body-2); + font: mat-font-weight($config, body-2) mat-font-size($config, body-2) + mat-font-family($config, body-2); } } diff --git a/src/lib/list/list.scss b/src/lib/list/list.scss index aee5121afba1..7f91e6596895 100644 --- a/src/lib/list/list.scss +++ b/src/lib/list/list.scss @@ -121,6 +121,7 @@ $mat-dense-list-icon-size: 20px; // This mixin adjusts the heights and padding based on whether the list is in dense mode. @mixin mat-subheader-spacing($top-padding, $base-height) { height: $base-height; + line-height: $base-height - $mat-list-side-padding * 2; &:first-child { margin-top: -$top-padding; From a6e4c7f8530fe63ef98f0ebffdd0aa375f560ef3 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 2 Aug 2017 14:25:02 +0200 Subject: [PATCH 2/2] Address feedback --- src/lib/list/_list-theme.scss | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/list/_list-theme.scss b/src/lib/list/_list-theme.scss index 9bb1ad9cc0db..2355a23d5c80 100644 --- a/src/lib/list/_list-theme.scss +++ b/src/lib/list/_list-theme.scss @@ -46,8 +46,9 @@ } .mat-subheader { - font: mat-font-weight($config, body-2) mat-font-size($config, body-2) - mat-font-family($config, body-2); + font-family: mat-font-family($config, body-2); + font-size: mat-font-size($config, body-2); + font-weight: mat-font-weight($config, body-2); } } @@ -59,7 +60,9 @@ } .mat-subheader { - font: mat-font-weight($config, body-2) mat-font-size($config, caption) $font-family; + font-family: $font-family; + font-size: mat-font-size($config, caption); + font-weight: mat-font-weight($config, body-2); } } }