Skip to content

Commit 24b9c15

Browse files
committed
fix(material/select): m3 box-shadow
1 parent fd13590 commit 24b9c15

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,8 @@
10121012
map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
10131013
focused-arrow-color: map.get($systems, md-sys-color, primary),
10141014
invalid-arrow-color: map.get($systems, md-sys-color, error),
1015+
container-elevation-shadow:
1016+
_hardcode(mdc-elevation.elevation-box-shadow(2), $exclude-hardcoded),
10151017
)
10161018
), (
10171019
// Color variants:

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
@use '../../token-utils';
22
@use '../../../theming/inspection';
33
@use '../../../style/sass-utils';
4+
@use '@material/elevation/elevation-theme' as mdc-elevation;
45

56
// The prefix used to generate the fully qualified name for tokens in this file.
67
$prefix: (mat, select);
78

89
// Tokens that can't be configured through Angular Material's current theming API,
910
// but may be in a future version of the theming API.
1011
@function get-unthemable-tokens() {
11-
@return ();
12+
@return (
13+
container-elevation-shadow: mdc-elevation.elevation-box-shadow(8),
14+
);
1215
}
1316

1417
// Tokens that can be configured through Angular Material's color theming API.

src/material/select/_select-theme.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
@if inspection.get-theme-version($theme) == 1 {
1616
@include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
1717
}
18-
@else {}
18+
@else {
19+
@include sass-utils.current-selector-or-root() {
20+
$mat-tokens: tokens-mat-select.get-unthemable-tokens();
21+
@include token-utils.create-token-values(tokens-mat-select.$prefix, $mat-tokens);
22+
}
23+
}
1924
}
2025

2126
/// Outputs color theme styles for the mat-select.

src/material/select/select.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ $scale: 0.75 !default;
3232
@include token-utils.create-token-slot(letter-spacing, trigger-text-tracking);
3333
}
3434
}
35+
@include token-utils.use-tokens(tokens-mat-select.$prefix, tokens-mat-select.get-token-slots()) {
36+
div.mat-mdc-select-panel {
37+
@include token-utils.create-token-slot(box-shadow, container-elevation-shadow);
38+
}
39+
}
3540

3641
.mat-mdc-select-disabled {
3742
@include token-utils.use-tokens(
@@ -131,7 +136,6 @@ $scale: 0.75 !default;
131136
// DOM for the Gmat versions to work. We need to bump up the specificity here
132137
// so that it's higher than MDC's styles.
133138
div.mat-mdc-select-panel {
134-
@include elevation.elevation(8);
135139
width: 100%; // Ensures that the panel matches the overlay width.
136140
max-height: $mat-select-panel-max-height;
137141
outline: 0;

0 commit comments

Comments
 (0)