From a9190d44f3e3f9a2d1e3ff488a9c233ddacc343c Mon Sep 17 00:00:00 2001 From: Miles Malerba Date: Tue, 21 Sep 2021 22:17:41 +0000 Subject: [PATCH] fix(material-experimental/mdc-menu): fix bold font when using 2014 typography --- src/material-experimental/mdc-menu/_menu-theme.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/material-experimental/mdc-menu/_menu-theme.scss b/src/material-experimental/mdc-menu/_menu-theme.scss index f84c6aa13296..ad798cf5bddf 100644 --- a/src/material-experimental/mdc-menu/_menu-theme.scss +++ b/src/material-experimental/mdc-menu/_menu-theme.scss @@ -1,3 +1,4 @@ +@use 'sass:map'; @use '@material/theme/theme-color' as mdc-theme-color; @use '@material/theme/theme' as mdc-theme; @use '@material/menu-surface' as mdc-menu-surface; @@ -47,6 +48,18 @@ @mixin typography($config-or-theme) { $config: typography.private-typography-to-2018-config( theming.get-typography-config($config-or-theme)); + + // When the 2014 typography config is mapped to the 2018 config, the font-weight that winds up + // getting used for menu items looks slightly off. In this case we override it to a value that + // looks better. + @if (typography.private-typography-is-2014-config($config-or-theme)) { + $config: map.merge($config, ( + body-1: map.merge(map.get($config, body-1), ( + font-weight: 400 + )) + )); + } + @include mdc-helpers.mat-using-mdc-typography($config) { @include mdc-menu-surface.core-styles(mdc-helpers.$mat-typography-styles-query);