Skip to content

Commit b5bf6f5

Browse files
crisbetojelbourn
authored andcommitted
fix(select): md-optgroup not using typography styles (#5193)
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.
1 parent 138abf8 commit b5bf6f5

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/lib/core/option/_optgroup-theme.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import '../theming/palette';
22
@import '../theming/theming';
3+
@import '../typography/typography-utils';
34

45
@mixin mat-optgroup-theme($theme) {
56
$foreground: map-get($theme, foreground);
@@ -12,3 +13,9 @@
1213
color: mat-color($foreground, hint-text);
1314
}
1415
}
16+
17+
@mixin mat-optgroup-typography($config) {
18+
.mat-optgroup-label {
19+
@include mat-typography-level-to-styles($config, body-2);
20+
}
21+
}

src/lib/core/option/_optgroup.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,5 @@
66
@include mat-menu-item-base();
77
@include user-select(none);
88
cursor: default;
9-
10-
// TODO(crisbeto): should use the typography functions once #4375 is in.
11-
font-weight: bold;
12-
font-size: 14px;
139
}
1410
}

src/lib/core/typography/_all-typography.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
@import '../../tooltip/tooltip-theme';
2525
@import '../../snack-bar/simple-snack-bar-theme';
2626
@import '../option/option-theme';
27+
@import '../option/optgroup-theme';
2728

2829

2930
// Includes all of the typographic styles.
@@ -53,5 +54,6 @@
5354
@include mat-tooltip-typography($config);
5455
@include mat-list-typography($config);
5556
@include mat-option-typography($config);
57+
@include mat-optgroup-typography($config);
5658
@include mat-simple-snack-bar-typography($config);
5759
}

0 commit comments

Comments
 (0)