From 87b2cf6a87a093031846194aa8165117d13d1fb9 Mon Sep 17 00:00:00 2001 From: mmalerba Date: Thu, 25 Apr 2019 13:16:50 -0700 Subject: [PATCH] chore: move null config check into mat-using-mdc-typography (#15906) --- .../mdc-button/_mdc-button.scss | 7 +------ src/material-experimental/mdc-card/_mdc-card.scss | 7 +------ .../mdc-checkbox/_mdc-checkbox.scss | 8 +------- .../mdc-helpers/_mdc-helpers.scss | 4 +++- src/material-experimental/mdc-menu/_mdc-menu.scss | 15 +++------------ .../mdc-radio/_mdc-radio.scss | 7 +------ .../mdc-slide-toggle/_mdc-slide-toggle.scss | 7 +------ 7 files changed, 11 insertions(+), 44 deletions(-) diff --git a/src/material-experimental/mdc-button/_mdc-button.scss b/src/material-experimental/mdc-button/_mdc-button.scss index 31a59dbe383..5e7e6d8190e 100644 --- a/src/material-experimental/mdc-button/_mdc-button.scss +++ b/src/material-experimental/mdc-button/_mdc-button.scss @@ -7,12 +7,7 @@ } @mixin mat-button-typography-mdc($config) { - @if config { - @include mat-using-mdc-typography($config) { - // TODO: MDC typography styles here. - } - } - @else { + @include mat-using-mdc-typography($config) { // TODO: MDC typography styles here. } } diff --git a/src/material-experimental/mdc-card/_mdc-card.scss b/src/material-experimental/mdc-card/_mdc-card.scss index adbf3335b01..ed41c765eee 100644 --- a/src/material-experimental/mdc-card/_mdc-card.scss +++ b/src/material-experimental/mdc-card/_mdc-card.scss @@ -7,12 +7,7 @@ } @mixin mat-card-typography-mdc($config) { - @if config { - @include mat-using-mdc-typography($config) { - // TODO: MDC typography styles here. - } - } - @else { + @include mat-using-mdc-typography($config) { // TODO: MDC typography styles here. } } diff --git a/src/material-experimental/mdc-checkbox/_mdc-checkbox.scss b/src/material-experimental/mdc-checkbox/_mdc-checkbox.scss index fec7c6e4615..a501ed87535 100644 --- a/src/material-experimental/mdc-checkbox/_mdc-checkbox.scss +++ b/src/material-experimental/mdc-checkbox/_mdc-checkbox.scss @@ -66,13 +66,7 @@ } @mixin mat-checkbox-typography-mdc($config: null) { - @if $config { - @include mat-using-mdc-typography($config) { - @include mdc-checkbox-without-ripple($query: $mat-typography-styles-query); - @include mdc-form-field-core-styles($query: $mat-typography-styles-query); - } - } - @else { + @include mat-using-mdc-typography($config) { @include mdc-checkbox-without-ripple($query: $mat-typography-styles-query); @include mdc-form-field-core-styles($query: $mat-typography-styles-query); } diff --git a/src/material-experimental/mdc-helpers/_mdc-helpers.scss b/src/material-experimental/mdc-helpers/_mdc-helpers.scss index 0a99477b2bf..f3d7db08898 100644 --- a/src/material-experimental/mdc-helpers/_mdc-helpers.scss +++ b/src/material-experimental/mdc-helpers/_mdc-helpers.scss @@ -199,7 +199,9 @@ $mat-typography-level-mappings: ( $orig-mdc-typography-styles: $mdc-typography-styles; // Set new values based on the given Angular Material typography configuration. - $mdc-typography-styles: mat-typography-config-to-mdc($config) !global; + @if $config { + $mdc-typography-styles: mat-typography-config-to-mdc($config) !global; + } // Apply given rules. @content; diff --git a/src/material-experimental/mdc-menu/_mdc-menu.scss b/src/material-experimental/mdc-menu/_mdc-menu.scss index f186d9e737d..7e221dc5ee3 100644 --- a/src/material-experimental/mdc-menu/_mdc-menu.scss +++ b/src/material-experimental/mdc-menu/_mdc-menu.scss @@ -39,21 +39,12 @@ } @mixin mat-menu-typography-mdc($config) { - @if config { - @include mat-using-mdc-typography($config) { - @include mdc-menu-surface-core-styles($mat-typography-styles-query); - - .mat-mdc-menu-content { - // Note that we include this private mixin, because the public - // one adds a bunch of styles that we aren't using for the menu. - @include mdc-list-base_($mat-typography-styles-query); - } - } - } - @else { + @include mat-using-mdc-typography($config) { @include mdc-menu-surface-core-styles($mat-typography-styles-query); .mat-mdc-menu-content { + // Note that we include this private mixin, because the public + // one adds a bunch of styles that we aren't using for the menu. @include mdc-list-base_($mat-typography-styles-query); } } diff --git a/src/material-experimental/mdc-radio/_mdc-radio.scss b/src/material-experimental/mdc-radio/_mdc-radio.scss index 36c6796bd03..70bc4c7fa41 100644 --- a/src/material-experimental/mdc-radio/_mdc-radio.scss +++ b/src/material-experimental/mdc-radio/_mdc-radio.scss @@ -7,12 +7,7 @@ } @mixin mat-radio-typography-mdc($config) { - @if config { - @include mat-using-mdc-typography($config) { - // TODO: MDC typography styles here. - } - } - @else { + @include mat-using-mdc-typography($config) { // TODO: MDC typography styles here. } } diff --git a/src/material-experimental/mdc-slide-toggle/_mdc-slide-toggle.scss b/src/material-experimental/mdc-slide-toggle/_mdc-slide-toggle.scss index 45af49a4657..e90515bcca0 100644 --- a/src/material-experimental/mdc-slide-toggle/_mdc-slide-toggle.scss +++ b/src/material-experimental/mdc-slide-toggle/_mdc-slide-toggle.scss @@ -7,12 +7,7 @@ } @mixin mat-slide-toggle-typography-mdc($config) { - @if config { - @include mat-using-mdc-typography($config) { - // TODO: MDC typography styles here. - } - } - @else { + @include mat-using-mdc-typography($config) { // TODO: MDC typography styles here. } }