Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(material-experimental/mdc-typography): better mappings for 2014 to 2018 typography #23618

Merged
merged 2 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/material-experimental/mdc-table/_table-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@
theming.get-typography-config($config-or-theme));
@include mdc-helpers.mat-using-mdc-typography($config) {
@include mdc-data-table.core-styles($query: mdc-helpers.$mat-typography-styles-query);

// MDC's header cell typography uses the `subtitle-2` config value. Due to legacy reasons,
// this value is mapped from Angular Material's `subheading-1` config value. This is not
// a perfect mapping because the Material spec shows the header having `font-weight: 500`
// instead of `subheading-1`'s default weight of 400. This override makes sure that the
// heading has the expected weight of 500.
.mat-mdc-header-cell {
font-weight: 500;
}
}
}

Expand Down
9 changes: 7 additions & 2 deletions src/material/core/typography/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,13 @@
headline-5: map.get($config, headline),
headline-6: map.get($config, title),
subtitle-1: map.get($config, subheading-2),
subtitle-2: map.get($config, subheading-1),
body-1: map.get($config, body-2),

// These mappings are odd, but body-2 in the 2014 system actually looks closer to subtitle-2
// in the 2018 system, and subeading-1 in the 2014 system looks more like body-1 in the 2018
// system.
subtitle-2: map.get($config, body-2),
body-1: map.get($config, subheading-1),

body-2: map.get($config, body-1),
button: map.get($config, button),
caption: map.get($config, caption),
Expand Down