Skip to content

Commit b116643

Browse files
authored
fix(material/core): require theme for option typography (#29416)
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.
1 parent 3f52e41 commit b116643

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

src/material/core/tokens/m2/mat/_optgroup.scss

-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@use '../../token-utils';
22
@use '../../../theming/inspection';
33
@use '../../../style/sass-utils';
4-
@use '../../../mdc-helpers/mdc-helpers';
54

65
// The prefix used to generate the fully qualified name for tokens in this file.
76
$prefix: (mat, optgroup);
@@ -21,14 +20,6 @@ $prefix: (mat, optgroup);
2120

2221
// Tokens that can be configured through Angular Material's typography theming API.
2322
@function get-typography-tokens($theme) {
24-
// TODO(crisbeto): The earlier implementation of the option used MDC's APIs to create the
25-
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
26-
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
27-
// fallback.
28-
@if ($theme == null) {
29-
$theme: mdc-helpers.private-fallback-typography-from-mdc();
30-
}
31-
3223
@return (
3324
label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
3425
label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),

src/material/core/tokens/m2/mat/_option.scss

-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@use '../../token-utils';
22
@use '../../../theming/inspection';
33
@use '../../../style/sass-utils';
4-
@use '../../../mdc-helpers/mdc-helpers';
54

65
// The prefix used to generate the fully qualified name for tokens in this file.
76
$prefix: (mat, option);
@@ -29,14 +28,6 @@ $prefix: (mat, option);
2928

3029
// Tokens that can be configured through Angular Material's typography theming API.
3130
@function get-typography-tokens($theme) {
32-
// TODO(crisbeto): The earlier implementation of the option used MDC's APIs to create the
33-
// typography tokens. As a result, we unintentionally allowed `null` typography configs to be
34-
// passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
35-
// fallback.
36-
@if ($theme == null) {
37-
$theme: mdc-helpers.private-fallback-typography-from-mdc();
38-
}
39-
4031
@return (
4132
label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
4233
label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),

0 commit comments

Comments
 (0)