Skip to content

Commit 02753e5

Browse files
committed
FINAL CLEANUP
1 parent c3491eb commit 02753e5

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

packages/tokens/scripts/build.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -83,33 +83,6 @@ StyleDictionary.registerTransform({
8383
}
8484
});
8585

86-
// StyleDictionary.registerTransform({
87-
// name: 'attributes/themeable',
88-
// type: 'attribute',
89-
// transform: (token: DesignToken) => {
90-
// let isThemeable = false;
91-
92-
// if ('$modes' in token) {
93-
// isThemeable = true;
94-
// }
95-
96-
// // TODO! understand how we can make this themeable using `usesReferences`/`getReferences` - see: https://hashicorp.atlassian.net/browse/HDS-5667
97-
// // if (token.key === "{typography.display-500.font-family}") {
98-
// // console.log('usesReferences', usesReferences(token.original.$value));
99-
// // const refs = getReferences(token.original.$value, StyleDictionaryInstance.tokenMap);
100-
// // console.log('refs', refs);
101-
// // }
102-
103-
// // TODO understand if we really need this to split themeable vs non-themeable tokens - see: https://hashicorp.atlassian.net/browse/HDS-5667
104-
// // if (usesReferences(token.original.$value)) {
105-
// // const refs = getReferences(token.original.$value, StyleDictionaryInstance.tokenMap);
106-
// // isThemeable = refs.some((ref) => '$modes' in ref);
107-
// // }
108-
109-
// return isThemeable ? { themeable: true } : { };
110-
// },
111-
// });
112-
11386
StyleDictionary.registerTransform({
11487
name: 'typography/font-family',
11588
type: 'value',
@@ -280,7 +253,7 @@ StyleDictionary.registerTransformGroup({
280253
// CUSTOM FORMATS
281254

282255
for (const target of ['common', 'themed']) {
283-
// note: customFormatCssThemedTokensFunction is a higher-order function, that takes `target` as argument and return a function of type `FormatFn`
256+
// note: customFormatCssThemedTokensFunction is a higher-order function, that takes `target` as argument and returns a "format" function
284257
const customFormatCssThemedTokensFunction = customFormatCssThemedTokensFunctionForTarget(target);
285258
StyleDictionary.registerFormat({
286259
name: `css/themed-tokens/with-root-selector/${target}`,
@@ -330,7 +303,6 @@ fs.emptyDirSync(distFolder);
330303

331304
// generate themed tokens
332305
for (const mode of modes) {
333-
// for (const mode of ['default']) {
334306
const StyleDictionaryInstance = new StyleDictionary(getStyleDictionaryConfig({ target: 'products', mode }));
335307
console.log(`\n---\n\nProcessing mode "${mode}"...`);
336308
await StyleDictionaryInstance.hasInitialized;

0 commit comments

Comments
 (0)