Skip to content

Revert "fix(material-experimental/mdc-typography): strip typography properties" #21961

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions src/material-experimental/mdc-helpers/_mdc-helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,12 @@ $mat-typography-2018-level-mappings: (
$mat-typography-2018-level-mappings, $mat-typography-2014-level-mappings);
$mdc-level: map-get(map-get($mappings, mat-to-mdc), $mat-level);

$result-with-nulls: map-merge(
@return map-merge(
if($mdc-level,
map-get($mdc-typography-styles, $mdc-level),
(
text-decoration: none,
text-transform: none,
-moz-osx-font-smoothing: grayscale,
-webkit-font-smoothing: antialiased
)),
Expand All @@ -112,19 +113,9 @@ $mat-typography-2018-level-mappings: (
letter-spacing: mat-letter-spacing($mat-config, $mat-level),
font-family: mat-font-family($mat-config, $mat-level),
// Angular Material doesn't use text-transform, so disable it.
text-transform: null,
text-transform: none,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like switching this back to none is all we need to fix it

),
()));

// We need to strip out any keys with a null value. Leaving them in will cause MDC to emit CSS
// variables with no fallback value, which breaks some builds.
$result: ();
@each $property, $value in $result-with-nulls {
@if $value != null {
$result: map-merge($result, ($property: $value));
}
}
@return $result;
}

// Converts an Angular Material typography config to an MDC one.
Expand Down