UNPKG

style-dictionary

Version:

Style once, use everywhere. A build system for creating cross-platform styles.

28 lines (25 loc) 729 B
/** * @typedef {import('../../../../types/DesignToken.d.ts').Dictionary} Dictionary * @typedef {import('../../../../types/File.d.ts').File} File * @typedef {import('../../../../types/Config.d.ts').Config} Config * @typedef {import('../../../../types/Config.d.ts').LocalOptions} LocalOptions */ /** * @param {{ * dictionary: Dictionary * options: Config & LocalOptions * file: File * header: string * }} opts */ export default ({ dictionary, options, file, header }) => ` // // ${file.destination ?? ''} // ${header} #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> ${dictionary.allTokens .map((token) => `#define ${token.name} ${options.usesDtcg ? token.$value : token.value}`) .join('\n')} `;