Skip to content

Commit e21b64c

Browse files
crisbetojelbourn
authored andcommitted
fix(expansion-panel): set up typography styles (#5739)
* Sets up the typography for the expansion panel module. * Starts using the appropriate typography styles from the config and fixes the panel not having a defined font family. * Fixes the panel content inheriting its font size from the body.
1 parent 5d5ce83 commit e21b64c

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@import '../../table/table-theme';
99
@import '../../datepicker/datepicker-theme';
1010
@import '../../dialog/dialog-theme';
11+
@import '../../expansion/expansion-theme';
1112
@import '../../grid-list/grid-list-theme';
1213
@import '../../icon/icon-theme';
1314
@import '../../input/input-theme';
@@ -45,6 +46,7 @@
4546
@include mat-table-typography($config);
4647
@include mat-datepicker-typography($config);
4748
@include mat-dialog-typography($config);
49+
@include mat-expansion-panel-typography($config);
4850
@include mat-grid-list-typography($config);
4951
@include mat-icon-typography($config);
5052
@include mat-input-typography($config);

src/lib/expansion/_expansion-theme.scss

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

45
@mixin mat-expansion-panel-theme($theme) {
56
$background: map-get($theme, background);
@@ -31,3 +32,17 @@
3132
color: mat-color($foreground, secondary-text);
3233
}
3334
}
35+
36+
@mixin mat-expansion-panel-typography($config) {
37+
.mat-expansion-panel-header {
38+
font: {
39+
family: mat-font-family($config);
40+
size: mat-font-size($config, subheading-1);
41+
weight: mat-font-weight($config, subheading-1);
42+
}
43+
}
44+
45+
.mat-expansion-panel-content {
46+
@include mat-typography-level-to-styles($config, body-1);
47+
}
48+
}

src/lib/expansion/expansion-panel-header.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ $mat-expansion-panel-header-height-expanded: 64px;
3535
.mat-expansion-panel-header-title {
3636
display: flex;
3737
flex-grow: 1;
38-
font-size: 15px;
3938
margin-right: 16px;
4039
}
4140

4241
.mat-expansion-panel-header-description {
4342
display: flex;
4443
flex-grow: 2;
45-
font-size: 15px;
4644
margin-right: 16px;
4745
}
4846

0 commit comments

Comments
 (0)