UNPKG

@nex-ui/system

Version:

A lightweight and performant styling library based on Emotion, focusing on component architecture and developer experience.

26 lines (22 loc) 707 B
'use strict'; var utils$1 = require('@nex-ui/utils'); var utils = require('./utils.cjs'); function createScales(scales) { const scaleMap = new Map(); for(const property in scales){ // istanbul ignore if if (!Object.hasOwn(scales, property)) continue; const category = scales[property]; if (!utils.isValidTokenCategory(category)) { if (utils$1.__DEV__) { console.error('[Nex-UI] sacles: Unknown token category: %s.', category); } continue; } scaleMap.set(property, category); } return { getCategoryByProperty: (key)=>scaleMap.get(key) }; } exports.createScales = createScales;