From 457cd904b9203e0c5f4c4a35862862aae2cba412 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 11 Jul 2024 09:06:55 +0200 Subject: [PATCH] fix(material/core): require theme for option typography Removes the fallback for generating typography tokens for `mat-option` and `mat-optgroup` even if there's no theme. This isn't a supported configuration and the previous setup was temporary. --- src/material/core/tokens/m2/mat/_optgroup.scss | 9 --------- src/material/core/tokens/m2/mat/_option.scss | 9 --------- 2 files changed, 18 deletions(-) diff --git a/src/material/core/tokens/m2/mat/_optgroup.scss b/src/material/core/tokens/m2/mat/_optgroup.scss index 644054627f4a..03c24ca30b29 100644 --- a/src/material/core/tokens/m2/mat/_optgroup.scss +++ b/src/material/core/tokens/m2/mat/_optgroup.scss @@ -1,7 +1,6 @@ @use '../../token-utils'; @use '../../../theming/inspection'; @use '../../../style/sass-utils'; -@use '../../../mdc-helpers/mdc-helpers'; // The prefix used to generate the fully qualified name for tokens in this file. $prefix: (mat, optgroup); @@ -21,14 +20,6 @@ $prefix: (mat, optgroup); // Tokens that can be configured through Angular Material's typography theming API. @function get-typography-tokens($theme) { - // TODO(crisbeto): The earlier implementation of the option used MDC's APIs to create the - // typography tokens. As a result, we unintentionally allowed `null` typography configs to be - // passed in. Since there a lot of apps that now depend on this pattern, we need this temporary - // fallback. - @if ($theme == null) { - $theme: mdc-helpers.private-fallback-typography-from-mdc(); - } - @return ( label-text-font: inspection.get-theme-typography($theme, body-1, font-family), label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height), diff --git a/src/material/core/tokens/m2/mat/_option.scss b/src/material/core/tokens/m2/mat/_option.scss index 321d408bbcf2..6718f1d96d98 100644 --- a/src/material/core/tokens/m2/mat/_option.scss +++ b/src/material/core/tokens/m2/mat/_option.scss @@ -1,7 +1,6 @@ @use '../../token-utils'; @use '../../../theming/inspection'; @use '../../../style/sass-utils'; -@use '../../../mdc-helpers/mdc-helpers'; // The prefix used to generate the fully qualified name for tokens in this file. $prefix: (mat, option); @@ -29,14 +28,6 @@ $prefix: (mat, option); // Tokens that can be configured through Angular Material's typography theming API. @function get-typography-tokens($theme) { - // TODO(crisbeto): The earlier implementation of the option used MDC's APIs to create the - // typography tokens. As a result, we unintentionally allowed `null` typography configs to be - // passed in. Since there a lot of apps that now depend on this pattern, we need this temporary - // fallback. - @if ($theme == null) { - $theme: mdc-helpers.private-fallback-typography-from-mdc(); - } - @return ( label-text-font: inspection.get-theme-typography($theme, body-1, font-family), label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),