Skip to content

Commit

Permalink
fix(material/core): don't use font shorthand property in typography-l…
Browse files Browse the repository at this point in the history
…evel (#26865)

This avoids overriding font properties with default values that can't be configured in the current typography config, e.g. the font-variant-caps or font-feature-settings property.

Fixes #26864

Co-authored-by: Jonathan Meier <[email protected]>
  • Loading branch information
jonathan-meier and Jonathan Meier committed Apr 4, 2023
1 parent c4026fe commit 1375505
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/material/core/typography/_typography-utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@
/// @param {Map} $config A typography config.
/// @param {Map} $level A typography level.
@mixin typography-level($config, $level) {
$font-size: font-size($config, $level);
$font-weight: font-weight($config, $level);
$line-height: line-height($config, $level);
$font-family: font-family($config, $level);
// we deliberately do not use the font shorthand here because it overrides
// certain font properties that can't be configured in the current typography
// config, e.g. the font-variant-caps or font-feature-settings property
font-size: font-size($config, $level);
font-weight: font-weight($config, $level);
line-height: line-height($config, $level);
font-family: font-family($config, $level);

@include font-shorthand($font-size, $font-weight, $line-height, $font-family);
letter-spacing: letter-spacing($config, $level);
}

Expand Down

0 comments on commit 1375505

Please sign in to comment.