File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments