Skip to content

Commit 7524b89

Browse files
authored
fix(material/datepicker): fix touchui shadow and border-radius (#28577)
* fix(material/datepicker): fix touchui shadow and border-radius * fix(material/datepicker): fix lint
1 parent d766b14 commit 7524b89

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/material-experimental/theming/_custom-tokens.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,10 @@
371371
calendar-container-text-color: map.get($systems, md-sys-color, on-surface),
372372
calendar-container-elevation-shadow: _hardcode(mdc-elevation.elevation-box-shadow(0),
373373
$exclude-hardcoded),
374+
calendar-container-touch-elevation-shadow: _hardcode(mdc-elevation.elevation-box-shadow(0),
375+
$exclude-hardcoded),
374376
calendar-container-shape: map.get($systems, md-sys-shape, corner-large),
377+
calendar-container-touch-shape: map.get($systems, md-sys-shape, corner-extra-large),
375378
calendar-text-font: map.get($systems, md-sys-typescale, body-large-font),
376379
calendar-text-size: map.get($systems, md-sys-typescale, body-large-size),
377380
calendar-body-label-text-size: map.get($systems, md-sys-typescale, title-small-size),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ $private-default-overlap-color: #a8dab5;
3333
@function get-unthemable-tokens() {
3434
@return (
3535
calendar-container-shape: 4px,
36+
calendar-container-touch-shape: 4px,
3637
calendar-container-elevation-shadow: mdc-elevation.elevation-box-shadow(4),
38+
calendar-container-touch-elevation-shadow: mdc-elevation.elevation-box-shadow(24),
3739
);
3840
}
3941

src/material/datepicker/datepicker-content.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use '../core/style/elevation';
21
@use '../core/tokens/m2/mat/datepicker' as tokens-mat-datepicker;
32
@use '../core/tokens/token-utils';
43

@@ -75,10 +74,15 @@ $touch-max-height: 788px;
7574
}
7675

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

80+
@include token-utils.use-tokens(
81+
tokens-mat-datepicker.$prefix, tokens-mat-datepicker.get-token-slots()) {
82+
@include token-utils.create-token-slot(box-shadow, calendar-container-touch-elevation-shadow);
83+
@include token-utils.create-token-slot(border-radius, calendar-container-touch-shape);
84+
}
85+
8286
// Allows for the screen reader close button to be seen in touch UI mode.
8387
position: relative;
8488

0 commit comments

Comments
 (0)