From 1b64e27eb9034657db2f4edff797a83386d07025 Mon Sep 17 00:00:00 2001 From: crisbeto Date: Sun, 18 Jun 2017 14:29:50 +0200 Subject: [PATCH] fix(select): md-optgroup not using typography styles Resolves a TODO from a while ago to set up the `md-optgroup` to use the typography API. This wasn't done initially since the typography PR and the option group PR got in around the same time. --- src/lib/core/option/_optgroup-theme.scss | 7 +++++++ src/lib/core/option/_optgroup.scss | 4 ---- src/lib/core/typography/_all-typography.scss | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/core/option/_optgroup-theme.scss b/src/lib/core/option/_optgroup-theme.scss index df2ee44725e4..17073224e009 100644 --- a/src/lib/core/option/_optgroup-theme.scss +++ b/src/lib/core/option/_optgroup-theme.scss @@ -1,5 +1,6 @@ @import '../theming/palette'; @import '../theming/theming'; +@import '../typography/typography-utils'; @mixin mat-optgroup-theme($theme) { $foreground: map-get($theme, foreground); @@ -12,3 +13,9 @@ color: mat-color($foreground, hint-text); } } + +@mixin mat-optgroup-typography($config) { + .mat-optgroup-label { + @include mat-typography-level-to-styles($config, body-2); + } +} diff --git a/src/lib/core/option/_optgroup.scss b/src/lib/core/option/_optgroup.scss index 8203ba4a8561..2ca79af39db1 100644 --- a/src/lib/core/option/_optgroup.scss +++ b/src/lib/core/option/_optgroup.scss @@ -6,9 +6,5 @@ @include mat-menu-item-base(); @include user-select(none); cursor: default; - - // TODO(crisbeto): should use the typography functions once #4375 is in. - font-weight: bold; - font-size: 14px; } } diff --git a/src/lib/core/typography/_all-typography.scss b/src/lib/core/typography/_all-typography.scss index d4c8bbdfbfdd..9477fd9fb5b2 100644 --- a/src/lib/core/typography/_all-typography.scss +++ b/src/lib/core/typography/_all-typography.scss @@ -24,6 +24,7 @@ @import '../../tooltip/tooltip-theme'; @import '../../snack-bar/simple-snack-bar-theme'; @import '../option/option-theme'; +@import '../option/optgroup-theme'; // Includes all of the typographic styles. @@ -53,5 +54,6 @@ @include mat-tooltip-typography($config); @include mat-list-typography($config); @include mat-option-typography($config); + @include mat-optgroup-typography($config); @include mat-simple-snack-bar-typography($config); }