|
1 |
| -@use 'sass:meta'; |
2 | 1 | @use 'sass:map';
|
3 |
| -@use './mat/app' as tokens-mat-app; |
4 |
| -@use './mat/autocomplete' as tokens-mat-autocomplete; |
5 |
| -@use './mat/badge' as tokens-mat-badge; |
6 |
| -@use './mat/text-button' as tokens-mat-text-button; |
7 |
| -@use './mat/protected-button' as tokens-mat-protected-button; |
8 |
| -@use './mat/filled-button' as tokens-mat-filled-button; |
9 |
| -@use './mat/outlined-button' as tokens-mat-outlined-button; |
10 |
| -@use './mat/dialog' as tokens-mat-dialog; |
11 |
| -@use './mat/bottom-sheet' as tokens-mat-bottom-sheet; |
12 |
| -@use './mat/card' as tokens-mat-card; |
13 |
| -@use './mat/chip' as tokens-mat-chip; |
14 |
| -@use './mat/datepicker' as tokens-mat-datepicker; |
15 |
| -@use './mat/divider' as tokens-mat-divider; |
16 |
| -@use './mat/expansion' as tokens-mat-expansion; |
17 |
| -@use './mat/fab' as tokens-mat-fab; |
18 |
| -@use './mat/fab-small' as tokens-mat-fab-small; |
19 |
| -@use './mat/form-field' as tokens-mat-form-field; |
20 |
| -@use './mat/grid-list' as tokens-mat-grid-list; |
21 |
| -@use './mat/icon' as tokens-mat-icon; |
22 |
| -@use './mat/icon-button' as tokens-mat-icon-button; |
23 |
| -@use './mat/list' as tokens-mat-list; |
24 |
| -@use './mat/menu' as tokens-mat-menu; |
25 |
| -@use './mat/option' as tokens-mat-option; |
26 |
| -@use './mat/optgroup' as tokens-mat-optgroup; |
27 |
| -@use './mat/paginator' as tokens-mat-paginator; |
28 |
| -@use './mat/checkbox' as tokens-mat-checkbox; |
29 |
| -@use './mat/full-pseudo-checkbox' as tokens-mat-full-pseudo-checkbox; |
30 |
| -@use './mat/minimal-pseudo-checkbox' as tokens-mat-minimal-pseudo-checkbox; |
31 |
| -@use './mat/radio' as tokens-mat-radio; |
32 |
| -@use './mat/ripple' as tokens-mat-ripple; |
33 |
| -@use './mat/select' as tokens-mat-select; |
34 |
| -@use './mat/sidenav' as tokens-mat-sidenav; |
35 |
| -@use './mat/slider' as tokens-mat-slider; |
36 |
| -@use './mat/switch' as tokens-mat-switch; |
37 |
| -@use './mat/snack-bar' as tokens-mat-snack-bar; |
38 |
| -@use './mat/sort' as tokens-mat-sort; |
39 |
| -@use './mat/standard-button-toggle' as tokens-mat-button-toggle; |
40 |
| -@use './mat/stepper' as tokens-mat-stepper; |
41 |
| -@use './mat/tab-header' as tokens-mat-tab-header; |
42 |
| -@use './mat/table' as tokens-mat-table; |
43 |
| -@use './mat/toolbar' as tokens-mat-toolbar; |
44 |
| -@use './mat/tree' as tokens-mat-tree; |
45 |
| -@use './mat/timepicker' as tokens-mat-timepicker; |
46 |
| -@use './mat/tonal-button' as tokens-mat-tonal-button; |
47 |
| -@use './mdc/checkbox' as tokens-mdc-checkbox; |
48 |
| -@use './mdc/text-button' as tokens-mdc-text-button; |
49 |
| -@use './mdc/protected-button' as tokens-mdc-protected-button; |
50 |
| -@use './mdc/filled-button' as tokens-mdc-filled-button; |
51 |
| -@use './mdc/outlined-button' as tokens-mdc-outlined-button; |
52 |
| -@use './mdc/chip' as tokens-mdc-chip; |
53 |
| -@use './mdc/circular-progress' as tokens-mdc-circular-progress; |
54 |
| -@use './mdc/dialog' as tokens-mdc-dialog; |
55 |
| -@use './mdc/elevated-card' as tokens-mdc-elevated-card; |
56 |
| -@use './mdc/extended-fab' as tokens-mdc-extended-fab; |
57 |
| -@use './mdc/fab' as tokens-mdc-fab; |
58 |
| -@use './mdc/fab-small' as tokens-mdc-fab-small; |
59 |
| -@use './mdc/filled-text-field' as tokens-mdc-filled-text-field; |
60 |
| -@use './mdc/icon-button' as tokens-mdc-icon-button; |
61 |
| -@use './mdc/linear-progress' as tokens-mdc-linear-progress; |
62 |
| -@use './mdc/list' as tokens-mdc-list; |
63 |
| -@use './mdc/outlined-card' as tokens-mdc-outlined-card; |
64 |
| -@use './mdc/outlined-text-field' as tokens-mdc-outlined-text-field; |
65 |
| -@use './mdc/plain-tooltip' as tokens-mdc-plain-tooltip; |
66 |
| -@use './mdc/radio' as tokens-mdc-radio; |
67 |
| -@use './mdc/slider' as tokens-mdc-slider; |
68 |
| -@use './mdc/snack-bar' as tokens-mdc-snack-bar; |
69 |
| -@use './mdc/switch' as tokens-mdc-switch; |
70 |
| -@use './mdc/secondary-navigation-tab' as tokens-mdc-secondary-navigation-tab; |
71 |
| -@use './mdc/tab-indicator' as tokens-mdc-tab-indicator; |
72 |
| - |
73 |
| -$_module-names: ( |
74 |
| - // Custom tokens |
75 |
| - tokens-mat-app, |
76 |
| - tokens-mat-autocomplete, |
77 |
| - tokens-mat-badge, |
78 |
| - tokens-mat-bottom-sheet, |
79 |
| - tokens-mat-button-toggle, |
80 |
| - tokens-mat-card, |
81 |
| - tokens-mat-chip, |
82 |
| - tokens-mat-datepicker, |
83 |
| - tokens-mat-dialog, |
84 |
| - tokens-mat-divider, |
85 |
| - tokens-mat-expansion, |
86 |
| - tokens-mat-fab, |
87 |
| - tokens-mat-fab-small, |
88 |
| - tokens-mat-filled-button, |
89 |
| - tokens-mat-tonal-button, |
90 |
| - tokens-mat-form-field, |
91 |
| - tokens-mat-grid-list, |
92 |
| - tokens-mat-icon-button, |
93 |
| - tokens-mat-icon, |
94 |
| - tokens-mat-menu, |
95 |
| - tokens-mat-optgroup, |
96 |
| - tokens-mat-option, |
97 |
| - tokens-mat-outlined-button, |
98 |
| - tokens-mat-paginator, |
99 |
| - tokens-mat-checkbox, |
100 |
| - tokens-mat-full-pseudo-checkbox, |
101 |
| - tokens-mat-list, |
102 |
| - tokens-mat-minimal-pseudo-checkbox, |
103 |
| - tokens-mat-protected-button, |
104 |
| - tokens-mat-radio, |
105 |
| - tokens-mat-ripple, |
106 |
| - tokens-mat-select, |
107 |
| - tokens-mat-sidenav, |
108 |
| - tokens-mat-slider, |
109 |
| - tokens-mat-switch, |
110 |
| - tokens-mat-snack-bar, |
111 |
| - tokens-mat-sort, |
112 |
| - tokens-mat-stepper, |
113 |
| - tokens-mat-tab-header, |
114 |
| - tokens-mat-table, |
115 |
| - tokens-mat-text-button, |
116 |
| - tokens-mat-toolbar, |
117 |
| - tokens-mat-tree, |
118 |
| - tokens-mat-timepicker, |
119 |
| - // MDC tokens |
120 |
| - tokens-mdc-checkbox, |
121 |
| - tokens-mdc-chip, |
122 |
| - tokens-mdc-text-button, |
123 |
| - tokens-mdc-protected-button, |
124 |
| - tokens-mdc-filled-button, |
125 |
| - tokens-mdc-outlined-button, |
126 |
| - tokens-mdc-chip, |
127 |
| - tokens-mdc-circular-progress, |
128 |
| - tokens-mdc-dialog, |
129 |
| - tokens-mdc-elevated-card, |
130 |
| - tokens-mdc-extended-fab, |
131 |
| - tokens-mdc-fab, |
132 |
| - tokens-mdc-fab-small, |
133 |
| - tokens-mdc-filled-text-field, |
134 |
| - tokens-mdc-icon-button, |
135 |
| - tokens-mdc-linear-progress, |
136 |
| - tokens-mdc-list, |
137 |
| - tokens-mdc-outlined-card, |
138 |
| - tokens-mdc-outlined-text-field, |
139 |
| - tokens-mdc-plain-tooltip, |
140 |
| - tokens-mdc-radio, |
141 |
| - tokens-mdc-slider, |
142 |
| - tokens-mdc-snack-bar, |
143 |
| - tokens-mdc-switch, |
144 |
| - tokens-mdc-secondary-navigation-tab, |
145 |
| - tokens-mdc-tab-indicator |
146 |
| -); |
| 2 | +@use './mat/app'; |
| 3 | +@use './mat/autocomplete'; |
| 4 | +@use './mat/badge'; |
| 5 | +@use './mat/bottom-sheet'; |
| 6 | +@use './mat/card'; |
| 7 | +@use './mat/checkbox'; |
| 8 | +@use './mat/chip'; |
| 9 | +@use './mat/circular-progress'; |
| 10 | +@use './mat/datepicker'; |
| 11 | +@use './mat/dialog'; |
| 12 | +@use './mat/divider'; |
| 13 | +@use './mat/elevated-card'; |
| 14 | +@use './mat/expansion'; |
| 15 | +@use './mat/extended-fab'; |
| 16 | +@use './mat/fab'; |
| 17 | +@use './mat/fab-small'; |
| 18 | +@use './mat/filled-button'; |
| 19 | +@use './mat/filled-text-field'; |
| 20 | +@use './mat/form-field'; |
| 21 | +@use './mat/full-pseudo-checkbox'; |
| 22 | +@use './mat/grid-list'; |
| 23 | +@use './mat/icon'; |
| 24 | +@use './mat/icon-button'; |
| 25 | +@use './mat/linear-progress'; |
| 26 | +@use './mat/list'; |
| 27 | +@use './mat/menu'; |
| 28 | +@use './mat/minimal-pseudo-checkbox'; |
| 29 | +@use './mat/optgroup'; |
| 30 | +@use './mat/option'; |
| 31 | +@use './mat/outlined-button'; |
| 32 | +@use './mat/outlined-card'; |
| 33 | +@use './mat/outlined-text-field'; |
| 34 | +@use './mat/paginator'; |
| 35 | +@use './mat/plain-tooltip'; |
| 36 | +@use './mat/protected-button'; |
| 37 | +@use './mat/radio'; |
| 38 | +@use './mat/ripple'; |
| 39 | +@use './mat/secondary-navigation-tab'; |
| 40 | +@use './mat/select'; |
| 41 | +@use './mat/sidenav'; |
| 42 | +@use './mat/slider'; |
| 43 | +@use './mat/snack-bar'; |
| 44 | +@use './mat/sort'; |
| 45 | +@use './mat/standard-button-toggle'; |
| 46 | +@use './mat/stepper'; |
| 47 | +@use './mat/switch'; |
| 48 | +@use './mat/tab-header'; |
| 49 | +@use './mat/tab-indicator'; |
| 50 | +@use './mat/table'; |
| 51 | +@use './mat/text-button'; |
| 52 | +@use './mat/timepicker'; |
| 53 | +@use './mat/tonal-button'; |
| 54 | +@use './mat/toolbar'; |
| 55 | +@use './mat/tree'; |
147 | 56 |
|
148 | 57 | /// Gets the full set of M3 tokens for the given theme object.
|
149 | 58 | /// @param {Map} $systems The MDC system tokens
|
150 | 59 | /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
151 | 60 | /// @param {Map} $token-slots Possible token slots
|
152 | 61 | /// @return {Map} Full set of M3 tokens
|
153 | 62 | @function get-m3-tokens($systems, $exclude-hardcoded, $token-slots) {
|
154 |
| - $tokens: (); |
| 63 | + $tokens-list: ( |
| 64 | + app.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 65 | + autocomplete.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 66 | + badge.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 67 | + bottom-sheet.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 68 | + card.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 69 | + checkbox.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 70 | + chip.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 71 | + circular-progress.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 72 | + datepicker.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 73 | + dialog.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 74 | + divider.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 75 | + elevated-card.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 76 | + expansion.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 77 | + extended-fab.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 78 | + fab.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 79 | + fab-small.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 80 | + filled-button.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 81 | + filled-text-field.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 82 | + form-field.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 83 | + full-pseudo-checkbox.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 84 | + grid-list.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 85 | + icon.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 86 | + icon-button.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 87 | + linear-progress.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 88 | + list.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 89 | + menu.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 90 | + minimal-pseudo-checkbox.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 91 | + optgroup.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 92 | + option.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 93 | + outlined-button.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 94 | + outlined-card.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 95 | + outlined-text-field.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 96 | + paginator.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 97 | + plain-tooltip.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 98 | + protected-button.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 99 | + radio.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 100 | + ripple.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 101 | + secondary-navigation-tab.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 102 | + select.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 103 | + sidenav.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 104 | + slider.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 105 | + snack-bar.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 106 | + sort.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 107 | + standard-button-toggle.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 108 | + stepper.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 109 | + switch.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 110 | + tab-header.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 111 | + tab-indicator.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 112 | + table.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 113 | + text-button.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 114 | + timepicker.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 115 | + tonal-button.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 116 | + toolbar.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 117 | + tree.get-tokens($systems, $exclude-hardcoded, $token-slots), |
| 118 | + ); |
155 | 119 |
|
156 |
| - @each $module-name in $_module-names { |
157 |
| - $fn: meta.get-function( |
158 |
| - $name: 'get-tokens', |
159 |
| - $module: $module-name, |
160 |
| - ); |
161 |
| - $tokens: map.deep-merge($tokens, meta.call($fn, $systems, $exclude-hardcoded, $token-slots)); |
| 120 | + $merged-tokens: (); |
| 121 | + @each $tokens in $tokens-list { |
| 122 | + $merged-tokens: map.deep-merge($merged-tokens, $tokens); |
162 | 123 | }
|
163 | 124 |
|
164 |
| - @return $tokens; |
| 125 | + @return $merged-tokens; |
165 | 126 | }
|
0 commit comments