Skip to content

Commit 4d070e4

Browse files
committed
checkin
1 parent 1e00c85 commit 4d070e4

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/material/autocomplete/autocomplete.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ div.mat-mdc-autocomplete-panel {
1919

2020
@include token-utils.use-tokens(
2121
tokens-mat-autocomplete.$prefix, tokens-mat-autocomplete.get-token-slots()) {
22-
@include token-utils.create-token-slot(border-radius, container-shape);
23-
@include token-utils.create-token-slot(box-shadow, container-elevation-shadow);
24-
@include token-utils.create-token-slot(background-color, background-color);
22+
border-radius: token-utils.slot(container-shape);
23+
box-shadow: token-utils.slot(container-elevation-shadow);
24+
background-color: token-utils.slot(background-color);
2525
}
2626

2727
@include cdk.high-contrast {

src/material/core/tokens/_token-utils.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,21 @@ $_system-fallbacks: m3-system.create-system-fallbacks();
7373
@mixin create-token-slot($property, $token, $fallback: null) {
7474
$_assert: _assert-use-tokens($token);
7575
@if map.get($_tokens, $token) != null {
76-
#{$property}: #{_get-token-value($token, $fallback)};
76+
#{$property}: #{slot($token, $fallback)};
77+
} @else {
78+
@error 'Missing token value for #{token}';
7779
}
7880
}
7981

82+
// Returns the token slot value.
83+
// Accepts an optional fallback parameter to include in the CSS variable.
84+
// If $fallback is `true`, then use the tokens map to get the fallback.
85+
// TODO: Remove the use case where we accept "true" and handle any failing client screenshots
86+
@function slot($token, $fallback: null) {
87+
$_assert: _assert-use-tokens($token);
88+
@return _get-token-value($token, $fallback);
89+
}
90+
8091
// Returns the name of a token including the current prefix. Intended to be used in calculations
8192
// involving tokens. `create-token-slot` should be used when outputting tokens.
8293
@function get-token-variable-name($token) {

0 commit comments

Comments
 (0)