Skip to content

fix(material/core): require theme for option typography #29416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/material/core/tokens/m2/mat/_optgroup.scss
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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),
Expand Down
9 changes: 0 additions & 9 deletions src/material/core/tokens/m2/mat/_option.scss
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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),
Expand Down
Loading