@nex-ui/system
Version:
A lightweight and performant styling library based on Emotion, focusing on component architecture and developer experience.
19 lines (16 loc) • 538 B
JavaScript
import { forEach, __DEV__ } from '@nex-ui/utils';
import { isValidTokenCategory } from './utils.mjs';
function createScales(scales) {
const scaleMap = new Map();
forEach(scales, (category, property)=>{
if (__DEV__ && !isValidTokenCategory(category)) {
console.error('[Nex-UI] sacles: Unknown token category: %s.', category);
return;
}
scaleMap.set(property, category);
});
return {
getCategoryByProperty: (key)=>scaleMap.get(key)
};
}
export { createScales };