UNPKG

@primer/primitives

Version:

Typography, spacing, and color primitives for Primer design system

14 lines (13 loc) 423 B
/** * @description extract prefix from platform and add to tokens array if defined * @param tokens StyleDictionary.TransformedTokens * @param platform StyleDictionary.Platform * @return StyleDictionary.TransformedTokens */ export const prefixTokens = (tokens, platform = {}) => { const { prefix } = platform; if (typeof prefix === 'string') { tokens = { [prefix]: tokens }; } return tokens; };