Skip to content

fix(material/datepicker): calendar font tokens not being picked up #29610

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
Aug 20, 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
2 changes: 1 addition & 1 deletion src/material/core/tokens/m2/mat/_datepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ $private-default-overlap-color: #a8dab5;
// that were set in the previous theming API to reduce the amount of subtle screenshot
// differences. We should look into introducing the other tokens in a follow-up.
calendar-text-font: inspection.get-theme-typography($theme, body-1, font-family),
calendar-text-size: 13px, // TODO(crisbeto): this doesn't appear to affect anything
calendar-text-size: 13px,

calendar-body-label-text-size: inspection.get-theme-typography($theme, button, font-size),
calendar-body-label-text-weight: inspection.get-theme-typography($theme, button, font-weight),
Expand Down
4 changes: 2 additions & 2 deletions src/material/core/tokens/m3/mat/_datepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ $prefix: (mat, datepicker);
token-definition.hardcode(elevation.get-box-shadow(0), $exclude-hardcoded),
calendar-container-shape: map.get($systems, md-sys-shape, corner-large),
calendar-container-touch-shape: map.get($systems, md-sys-shape, corner-extra-large),
calendar-text-font: map.get($systems, md-sys-typescale, body-large-font),
calendar-text-size: map.get($systems, md-sys-typescale, body-large-size),
calendar-text-font: map.get($systems, md-sys-typescale, body-medium-font),
calendar-text-size: map.get($systems, md-sys-typescale, body-medium-size),
calendar-body-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
calendar-body-label-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
calendar-period-button-text-size: map.get($systems, md-sys-typescale, title-small-size),
Expand Down
7 changes: 7 additions & 0 deletions src/material/datepicker/calendar-body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ $_tokens: (tokens-mat-datepicker.$prefix, tokens-mat-datepicker.get-token-slots(
outline: none;
font-family: inherit;
margin: 0;

// Needs to be repeated here in order to override the user agent styles.
@include token-utils.use-tokens($_tokens...) {
@include token-utils.create-token-slot(font-family, calendar-text-font);
@include token-utils.create-token-slot(font-size, calendar-text-size);
}

@include button-common.reset();
}

Expand Down
Loading