Skip to content

Commit fd58310

Browse files
jonathan-meierJonathan Meier
authored andcommitted
fix(material/core): don't use font shorthand property in typography-level (#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 <jome@google.com> (cherry picked from commit 1375505)
1 parent cc5f7d0 commit fd58310

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/material/core/typography/_typography-utils.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,14 @@
8686
/// @param {Map} $config A typography config.
8787
/// @param {Map} $level A typography level.
8888
@mixin typography-level($config, $level) {
89-
$font-size: font-size($config, $level);
90-
$font-weight: font-weight($config, $level);
91-
$line-height: line-height($config, $level);
92-
$font-family: font-family($config, $level);
89+
// we deliberately do not use the font shorthand here because it overrides
90+
// certain font properties that can't be configured in the current typography
91+
// config, e.g. the font-variant-caps or font-feature-settings property
92+
font-size: font-size($config, $level);
93+
font-weight: font-weight($config, $level);
94+
line-height: line-height($config, $level);
95+
font-family: font-family($config, $level);
9396

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

0 commit comments

Comments
 (0)