Skip to content

Commit

Permalink
fix(material/datepicker): fix touchui shadow and border-radius
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewseguin committed Feb 12, 2024
1 parent 78a292b commit b77bf93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/material-experimental/theming/_custom-tokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,10 @@
calendar-container-text-color: map.get($systems, md-sys-color, on-surface),
calendar-container-elevation-shadow: _hardcode(mdc-elevation.elevation-box-shadow(0),
$exclude-hardcoded),
calendar-container-touch-elevation-shadow: _hardcode(mdc-elevation.elevation-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-body-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
Expand Down
2 changes: 2 additions & 0 deletions src/material/core/tokens/m2/mat/_datepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ $private-default-overlap-color: #a8dab5;
@function get-unthemable-tokens() {
@return (
calendar-container-shape: 4px,
calendar-container-touch-shape: 4px,
calendar-container-elevation-shadow: mdc-elevation.elevation-box-shadow(4),
calendar-container-touch-elevation-shadow: mdc-elevation.elevation-box-shadow(24),
);
}

Expand Down
7 changes: 6 additions & 1 deletion src/material/datepicker/datepicker-content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@ $touch-max-height: 788px;
}

.mat-datepicker-content-touch {
@include elevation.elevation(24);
display: block;
max-height: 80vh;

@include token-utils.use-tokens(
tokens-mat-datepicker.$prefix, tokens-mat-datepicker.get-token-slots()) {
@include token-utils.create-token-slot(box-shadow, calendar-container-touch-elevation-shadow);
@include token-utils.create-token-slot(border-radius, calendar-container-touch-shape);
}

// Allows for the screen reader close button to be seen in touch UI mode.
position: relative;

Expand Down

0 comments on commit b77bf93

Please sign in to comment.