1- @use ' ../m2' as m2-theming ;
21@use ' ../style/sass-utils' ;
3- @use ' ./m2-tokens' ;
42@use ' ./m3' ;
53@use ' sass:map' ;
64
7- $_cached-token-slots : null;
8-
9- /// Determines the token slots for all components.
10- @function _get-token-slots () {
11- // Cache the slots since they're constant and calculating
12- // them appears to be expensive (see #29009).
13- @if ($_cached-token-slots ) {
14- @return $_cached-token-slots ;
15- }
16-
17- // TODO(mmalerba): Refactor this to not depend on the legacy theme when moving out of
18- // material-experimental. This is a hack for now because there is no good way to get the token
19- // slots in material-experimental without exposing them all from material.
20- $fake-theme : m2-theming .define-light-theme ((
21- color : (
22- primary: m2-theming .define-palette (m2-theming .$red-palette ),
23- accent: m2-theming .define-palette (m2-theming .$red-palette ),
24- warn: m2-theming .define-palette (m2-theming .$red-palette ),
25- ),
26- typography: m2-theming .define-typography-config (),
27- density: 0
28- ));
29- $_cached-token-slots : m2-tokens .m2-tokens-from-theme ($fake-theme ) !global;
30- @return $_cached-token-slots ;
31- }
32-
335/// Generates a set of namespaced tokens for all components.
346/// @param {Map} $systems The MDC system tokens
357/// @param {Boolean} $include-non-systemized Whether to include non-systemized tokens
@@ -46,8 +18,6 @@ $_cached-token-slots: null;
4618 ), $systems );
4719 $exclude-hardcoded : not $include-non-systemized ;
4820
49- $token-slots : _get-token-slots ();
50-
5121 // TODO(mmalerba): Fill in remaining tokens.
5222 $result : sass-utils .deep-merge-all (
5323 // Add the system color & typography tokens (so we can give users access via an API).
0 commit comments