Skip to content

Commit 87b2cf6

Browse files
authored
chore: move null config check into mat-using-mdc-typography (#15906)
1 parent 8f23917 commit 87b2cf6

File tree

7 files changed

+11
-44
lines changed

7 files changed

+11
-44
lines changed

src/material-experimental/mdc-button/_mdc-button.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
}
88

99
@mixin mat-button-typography-mdc($config) {
10-
@if config {
11-
@include mat-using-mdc-typography($config) {
12-
// TODO: MDC typography styles here.
13-
}
14-
}
15-
@else {
10+
@include mat-using-mdc-typography($config) {
1611
// TODO: MDC typography styles here.
1712
}
1813
}

src/material-experimental/mdc-card/_mdc-card.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
}
88

99
@mixin mat-card-typography-mdc($config) {
10-
@if config {
11-
@include mat-using-mdc-typography($config) {
12-
// TODO: MDC typography styles here.
13-
}
14-
}
15-
@else {
10+
@include mat-using-mdc-typography($config) {
1611
// TODO: MDC typography styles here.
1712
}
1813
}

src/material-experimental/mdc-checkbox/_mdc-checkbox.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,7 @@
6666
}
6767

6868
@mixin mat-checkbox-typography-mdc($config: null) {
69-
@if $config {
70-
@include mat-using-mdc-typography($config) {
71-
@include mdc-checkbox-without-ripple($query: $mat-typography-styles-query);
72-
@include mdc-form-field-core-styles($query: $mat-typography-styles-query);
73-
}
74-
}
75-
@else {
69+
@include mat-using-mdc-typography($config) {
7670
@include mdc-checkbox-without-ripple($query: $mat-typography-styles-query);
7771
@include mdc-form-field-core-styles($query: $mat-typography-styles-query);
7872
}

src/material-experimental/mdc-helpers/_mdc-helpers.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ $mat-typography-level-mappings: (
199199
$orig-mdc-typography-styles: $mdc-typography-styles;
200200

201201
// Set new values based on the given Angular Material typography configuration.
202-
$mdc-typography-styles: mat-typography-config-to-mdc($config) !global;
202+
@if $config {
203+
$mdc-typography-styles: mat-typography-config-to-mdc($config) !global;
204+
}
203205

204206
// Apply given rules.
205207
@content;

src/material-experimental/mdc-menu/_mdc-menu.scss

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,12 @@
3939
}
4040

4141
@mixin mat-menu-typography-mdc($config) {
42-
@if config {
43-
@include mat-using-mdc-typography($config) {
44-
@include mdc-menu-surface-core-styles($mat-typography-styles-query);
45-
46-
.mat-mdc-menu-content {
47-
// Note that we include this private mixin, because the public
48-
// one adds a bunch of styles that we aren't using for the menu.
49-
@include mdc-list-base_($mat-typography-styles-query);
50-
}
51-
}
52-
}
53-
@else {
42+
@include mat-using-mdc-typography($config) {
5443
@include mdc-menu-surface-core-styles($mat-typography-styles-query);
5544

5645
.mat-mdc-menu-content {
46+
// Note that we include this private mixin, because the public
47+
// one adds a bunch of styles that we aren't using for the menu.
5748
@include mdc-list-base_($mat-typography-styles-query);
5849
}
5950
}

src/material-experimental/mdc-radio/_mdc-radio.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
}
88

99
@mixin mat-radio-typography-mdc($config) {
10-
@if config {
11-
@include mat-using-mdc-typography($config) {
12-
// TODO: MDC typography styles here.
13-
}
14-
}
15-
@else {
10+
@include mat-using-mdc-typography($config) {
1611
// TODO: MDC typography styles here.
1712
}
1813
}

src/material-experimental/mdc-slide-toggle/_mdc-slide-toggle.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
}
88

99
@mixin mat-slide-toggle-typography-mdc($config) {
10-
@if config {
11-
@include mat-using-mdc-typography($config) {
12-
// TODO: MDC typography styles here.
13-
}
14-
}
15-
@else {
10+
@include mat-using-mdc-typography($config) {
1611
// TODO: MDC typography styles here.
1712
}
1813
}

0 commit comments

Comments
 (0)